Add bitvec-like generic support to the scale-bits type for use in codegen (#718)

* Add bitvec-like generic support to the scale-bits type for use in codegen

* Use nightly 1.66 formatting

* Fix reading input while decoding bit sequences

* Add tests for our DecodedBits wrapper

* Add convenience DecodedBits::(in)to_bits functions

* Don't expose DecodedBits::bit_format

* Re-export scale_bits as peer dependency

* Move subxt::utils into a separate file

* Hide DecodedBits internals

* Don't re-export types from the `bits` module

* Update subxt/src/utils/bits.rs

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* Update subxt/src/utils/bits.rs

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* Address review feedback

* Clarify the byte needed calculation in DecodedBits encoding

* Remove remaining dbg! invocations

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
This commit is contained in:
Igor Matuszewski
2022-11-24 15:09:20 +01:00
committed by GitHub
parent a80d6cfd30
commit f0ce26db7b
9 changed files with 273 additions and 28 deletions
+2 -2
View File
@@ -161,11 +161,11 @@ impl RuntimeGenerator {
let mut type_substitutes = [
(
"bitvec::order::Lsb0",
parse_quote!(#crate_path::ext::bitvec::order::Lsb0),
parse_quote!(#crate_path::utils::bits::Lsb0),
),
(
"bitvec::order::Msb0",
parse_quote!(#crate_path::ext::bitvec::order::Msb0),
parse_quote!(#crate_path::utils::bits::Msb0),
),
(
"sp_core::crypto::AccountId32",