Add more tests for events.rs/decode_and_consume_type (#430)

* test-runtime: Fix README typo

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* test-runtime: Explicit error handling for missing substrate binary

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* test-runtime: Fix documentation typo

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* events: Test primitive decode_and_consume

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* events: Test tuple decode_and_consume

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* events: Test array decode_and_consume

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* events: Extend array with sequences

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* events: Test variant decode_and_consume

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* events: Test composite decode_and_consume

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* events: Test compact decode_and_consume

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2022-02-04 12:46:39 +02:00
committed by GitHub
parent abd7a4145b
commit 868b465e01
3 changed files with 195 additions and 3 deletions
+2 -2
View File
@@ -3,8 +3,8 @@
The logic for this crate exists mainly in the `build.rs` file.
At compile time, this crate will:
- Spin up a local `substrate` binary (set the `SUBSTRATE_NODE_PATH` env var to point to a custom binary, otehrwise it'll look for `substrate` on your PATH).
- Spin up a local `substrate` binary (set the `SUBSTRATE_NODE_PATH` env var to point to a custom binary, otherwise it'll look for `substrate` on your PATH).
- Obtain metadata from this node.
- Export the metadata and a `node_runtime` module which has been annotated using the `subxt` proc macro and is based off the above metadata.
The reason for doing this is that our integration tests (which also spin up a Substrate node) can then use the generated `subxt` types from the exact node being tested against, so that we don't have to worry about metadata getting out of sync with the binary under test.
The reason for doing this is that our integration tests (which also spin up a Substrate node) can then use the generated `subxt` types from the exact node being tested against, so that we don't have to worry about metadata getting out of sync with the binary under test.