diff --git a/substrate/primitives/src/networks.rs b/substrate/primitives/src/networks.rs index 285f2947e..64cf7cc2e 100644 --- a/substrate/primitives/src/networks.rs +++ b/substrate/primitives/src/networks.rs @@ -95,7 +95,7 @@ impl Decode for NetworkId { let kind = input.read_byte()?; match kind { 0 => Ok(Self::Serai), - _ => Ok(ExternalNetworkId::decode(input)?.into()), + _ => Ok(ExternalNetworkId::decode(&mut [kind].as_slice())?.into()), } } } @@ -264,7 +264,7 @@ impl Decode for Coin { let kind = input.read_byte()?; match kind { 0 => Ok(Self::Serai), - _ => Ok(ExternalCoin::decode(input)?.into()), + _ => Ok(ExternalCoin::decode(&mut [kind].as_slice())?.into()), } } } diff --git a/tests/processor/src/tests/batch.rs b/tests/processor/src/tests/batch.rs index 2428a456a..4a34500ea 100644 --- a/tests/processor/src/tests/batch.rs +++ b/tests/processor/src/tests/batch.rs @@ -13,7 +13,7 @@ use serai_client::{ }, primitives::{ crypto::RuntimePublic, Amount, BlockHash, ExternalBalance, ExternalNetworkId, PublicKey, - SeraiAddress, + SeraiAddress, EXTERNAL_NETWORKS, }, validator_sets::primitives::Session, }; @@ -190,9 +190,7 @@ pub(crate) async fn substrate_block( #[test] fn batch_test() { - for network in - [ExternalNetworkId::Bitcoin, ExternalNetworkId::Ethereum, ExternalNetworkId::Monero] - { + for network in EXTERNAL_NETWORKS { let (coordinators, test) = new_test(network); test.run(|ops| async move {