Skip to content

Commit

Permalink
fix encode/decode
Browse files Browse the repository at this point in the history
  • Loading branch information
akildemir committed Oct 4, 2024
1 parent 43cdbb1 commit 1ea3ee0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions substrate/primitives/src/networks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
}
}
}
Expand Down Expand Up @@ -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()),
}
}
}
Expand Down
6 changes: 2 additions & 4 deletions tests/processor/src/tests/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use serai_client::{
},
primitives::{
crypto::RuntimePublic, Amount, BlockHash, ExternalBalance, ExternalNetworkId, PublicKey,
SeraiAddress,
SeraiAddress, EXTERNAL_NETWORKS,
},
validator_sets::primitives::Session,
};
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 1ea3ee0

Please sign in to comment.