mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-14 15:09:23 +00:00
fix encode/decode
This commit is contained in:
@@ -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()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user