You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This error crops up when attempting to build subxt against the latest substrate master.
It occurs because BoundedBTreeMap<K,V> is a generated struct that contains a BTreeMap<K,V>, and Decode is only implemented on BTreeMap<K,V> if K: Ord.
In the erroneous case, we generate a BoundedBTreeMap<ElectionScore, u32>, and ElectionScore is another generated type which gets the default derives that we apply to all generated types (which doesn't include Ord).
Adding Ord (and thus also adding PartialOrd, Eq, PartialEq) to all types doesn't work out (loads of things can't impl this).
The best idea I have offhand is to iterate through the type registry looking for anything called "BTreeMap", and then adding the type ID of the first parameter it takes to some list. Later, when we generate all of our types, make sure that those IDs get the extra traits that they need to allow Decoding when they are keys in a BTreeMap.
The text was updated successfully, but these errors were encountered:
This error crops up when attempting to build subxt against the latest substrate master.
It occurs because
BoundedBTreeMap<K,V>
is a generated struct that contains aBTreeMap<K,V>
, andDecode
is only implemented onBTreeMap<K,V>
ifK: Ord
.In the erroneous case, we generate a
BoundedBTreeMap<ElectionScore, u32>
, andElectionScore
is another generated type which gets the default derives that we apply to all generated types (which doesn't includeOrd
).Adding
Ord
(and thus also addingPartialOrd, Eq, PartialEq
) to all types doesn't work out (loads of things can't impl this).The best idea I have offhand is to iterate through the type registry looking for anything called "BTreeMap", and then adding the type ID of the first parameter it takes to some list. Later, when we generate all of our types, make sure that those IDs get the extra traits that they need to allow Decoding when they are keys in a
BTreeMap
.The text was updated successfully, but these errors were encountered: