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
+5 -1
View File
@@ -58,6 +58,10 @@ async fn run() {
.spawn();
let mut cmd = match cmd {
Ok(cmd) => KillOnDrop(cmd),
Err(ref e) if e.kind() == std::io::ErrorKind::NotFound => {
panic!("A substrate binary should be installed on your path for testing purposes. \
See https://github.com/paritytech/subxt/tree/master#integration-testing")
}
Err(e) => {
panic!("Cannot spawn substrate command '{}': {}", substrate_bin, e)
}
@@ -164,7 +168,7 @@ fn next_open_port() -> Option<u16> {
}
}
/// If the substrate process isn't explicilty killed on drop,
/// If the substrate process isn't explicitly killed on drop,
/// it seems that panics that occur while the command is running
/// will leave it running and block the build step from ever finishing.
/// Wrapping it in this prevents this from happening.