Runtime agnostic Events (#20)

* Introduce OpaqueEvent

* Look up event by module and variant

* Index events by module

* Get events by module

* Dynamically decode events

* Decode System events and EventRecord topics

* Use type sizes to decode raw events

* Remove unused imports

* rustfmt

* Unify error types, fix some compiler errors

* Make dynamic event decoding work

- fix compilation errors
- skip modules with no events when indexing
- preallocate vec for raw event data

* Remove printlns, replace where required with log

* Remove unused import

* Check missing type sizes

* Ignore unknown event arg type sizes

* Decode concrete System events, assumes every Runtime has the module

* Reorganise usings

* pub use some types

* Code docs

* Export Error

* Error Display impls

* Format code
This commit is contained in:
Andrew Jones
2019-09-26 17:48:25 +01:00
committed by GitHub
parent f9ae14bdb9
commit ee6db12917
8 changed files with 595 additions and 99 deletions
+1
View File
@@ -35,6 +35,7 @@ url = "1.7"
env_logger = "0.6"
node-runtime = { git = "https://github.com/paritytech/substrate/", package = "node-runtime" }
srml-balances = { git = "https://github.com/paritytech/substrate/", package = "srml-balances" }
srml-contracts = { git = "https://github.com/paritytech/substrate/", package = "srml-contracts" }
substrate-keyring = { git = "https://github.com/paritytech/substrate/", package = "substrate-keyring" }
tokio = "0.1"
wabt = "0.9.0"