Add hooks to register event types for decoding (#227)

* Global registration of type segmenters for event decoding

* Perform type sizes check when building client

* Introduce EventTypeRegistry for global runtime type sizes

* Fmt

* Register runtime type sizes on creation of EventTypeRegistry

* Register more default dispatch types

* Add missing type sizes

* fmt

* Fix up register_type_size builder method

* Update doc comments

* Make register_default_type_sizes public

* Don't allow duplicate registered types

* Remove call to supertraits type registration, done manually in Runtime

* Fix tests and warnings

* Fix duplicate type registration

* Fmt

* review: use is_empty()

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

* Add panic docs

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
This commit is contained in:
Andrew Jones
2021-02-18 10:28:40 +00:00
committed by GitHub
parent 2c8e5211aa
commit de859e7396
19 changed files with 436 additions and 280 deletions
+1
View File
@@ -36,6 +36,7 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features =
# temporarily pinning funty via codec -> bitvec until https://github.com/myrrlyn/funty/issues/3
# and https://github.com/bitvecto-rs/bitvec/issues/105 are resolved
funty = "=1.1.0"
dyn-clone = "1.0.4"
frame-metadata = "13.0.0"
frame-support = "3.0.0"