mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-23 03:47:59 +00:00
Substitute BTreeMap/BTreeSet generated types for Vec (#459)
* Substitute BTreeMap/BTreeSet for Vec * regen code * cargo fmt * undo test tweak since not substituting bounded things at the mo * add a couple of comments
This commit is contained in:
@@ -147,12 +147,12 @@ impl RuntimeGenerator {
|
||||
"frame_support::traits::misc::WrapperKeepOpaque",
|
||||
parse_quote!(::subxt::WrapperKeepOpaque),
|
||||
),
|
||||
// We override this because it's used as a key in a BTreeMap, and so we
|
||||
// need to implement some extra derives for it for that to compile.
|
||||
(
|
||||
"sp_npos_elections::ElectionScore",
|
||||
parse_quote!(::subxt::ElectionScore),
|
||||
),
|
||||
// BTreeMap and BTreeSet impose an `Ord` constraint on their key types. This
|
||||
// can cause an issue with generated code that doesn't impl `Ord` by default.
|
||||
// Decoding them to Vec by default (KeyedVec is just an alias for Vec with
|
||||
// suitable type params) avoids these issues.
|
||||
("BTreeMap", parse_quote!(::subxt::KeyedVec)),
|
||||
("BTreeSet", parse_quote!(::std::vec::Vec)),
|
||||
]
|
||||
.iter()
|
||||
.map(|(path, substitute): &(&str, syn::TypePath)| {
|
||||
|
||||
Reference in New Issue
Block a user