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()?;
|
let kind = input.read_byte()?;
|
||||||
match kind {
|
match kind {
|
||||||
0 => Ok(Self::Serai),
|
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()?;
|
let kind = input.read_byte()?;
|
||||||
match kind {
|
match kind {
|
||||||
0 => Ok(Self::Serai),
|
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::{
|
primitives::{
|
||||||
crypto::RuntimePublic, Amount, BlockHash, ExternalBalance, ExternalNetworkId, PublicKey,
|
crypto::RuntimePublic, Amount, BlockHash, ExternalBalance, ExternalNetworkId, PublicKey,
|
||||||
SeraiAddress,
|
SeraiAddress, EXTERNAL_NETWORKS,
|
||||||
},
|
},
|
||||||
validator_sets::primitives::Session,
|
validator_sets::primitives::Session,
|
||||||
};
|
};
|
||||||
@@ -190,9 +190,7 @@ pub(crate) async fn substrate_block(
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn batch_test() {
|
fn batch_test() {
|
||||||
for network in
|
for network in EXTERNAL_NETWORKS {
|
||||||
[ExternalNetworkId::Bitcoin, ExternalNetworkId::Ethereum, ExternalNetworkId::Monero]
|
|
||||||
{
|
|
||||||
let (coordinators, test) = new_test(network);
|
let (coordinators, test) = new_test(network);
|
||||||
|
|
||||||
test.run(|ops| async move {
|
test.run(|ops| async move {
|
||||||
|
|||||||
Reference in New Issue
Block a user