mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-10 05:09:22 +00:00
add specific network/coin/balance types (#619)
* add specific network/coin/balance types * misc fixes * fix clippy * misc fixes * fix pr comments * Make halting for external networks * fix encode/decode
This commit is contained in:
@@ -6,7 +6,7 @@ use transcript::{Transcript, RecommendedTranscript};
|
||||
use ciphersuite::group::GroupEncoding;
|
||||
use frost::curve::Ciphersuite;
|
||||
|
||||
use serai_client::primitives::Balance;
|
||||
use serai_client::primitives::ExternalBalance;
|
||||
|
||||
use crate::{
|
||||
networks::{Output, Network},
|
||||
@@ -17,7 +17,7 @@ use crate::{
|
||||
pub struct Payment<N: Network> {
|
||||
pub address: N::Address,
|
||||
pub data: Option<Vec<u8>>,
|
||||
pub balance: Balance,
|
||||
pub balance: ExternalBalance,
|
||||
}
|
||||
|
||||
impl<N: Network> Payment<N> {
|
||||
@@ -69,7 +69,7 @@ impl<N: Network> Payment<N> {
|
||||
None
|
||||
};
|
||||
|
||||
let balance = Balance::decode(&mut scale::IoReader(reader))
|
||||
let balance = ExternalBalance::decode(&mut scale::IoReader(reader))
|
||||
.map_err(|_| io::Error::other("invalid balance"))?;
|
||||
|
||||
Ok(Payment { address, data, balance })
|
||||
|
||||
Reference in New Issue
Block a user