Finish merging in the develop branch

This commit is contained in:
Luke Parker
2025-01-30 03:14:24 -05:00
parent 258c02ff39
commit a275023cfc
62 changed files with 452 additions and 508 deletions

View File

@@ -5,7 +5,7 @@ use group::GroupEncoding;
use borsh::{BorshSerialize, BorshDeserialize};
use serai_primitives::{ExternalAddress, Balance};
use serai_primitives::{ExternalAddress, ExternalBalance};
use crate::Id;
@@ -133,7 +133,7 @@ pub trait ReceivedOutput<K: GroupEncoding, A: Address>:
fn presumed_origin(&self) -> Option<A>;
/// The balance associated with this output.
fn balance(&self) -> Balance;
fn balance(&self) -> ExternalBalance;
/// The arbitrary data (presumably an InInstruction) associated with this output.
fn data(&self) -> &[u8];

View File

@@ -3,7 +3,7 @@ use std::io;
use scale::{Encode, Decode, IoReader};
use borsh::{BorshSerialize, BorshDeserialize};
use serai_primitives::Balance;
use serai_primitives::ExternalBalance;
use serai_coins_primitives::OutInstructionWithBalance;
use crate::Address;
@@ -12,7 +12,7 @@ use crate::Address;
#[derive(Clone, BorshSerialize, BorshDeserialize)]
pub struct Payment<A: Address> {
address: A,
balance: Balance,
balance: ExternalBalance,
}
impl<A: Address> TryFrom<OutInstructionWithBalance> for Payment<A> {
@@ -27,7 +27,7 @@ impl<A: Address> TryFrom<OutInstructionWithBalance> for Payment<A> {
impl<A: Address> Payment<A> {
/// Create a new Payment.
pub fn new(address: A, balance: Balance) -> Self {
pub fn new(address: A, balance: ExternalBalance) -> Self {
Payment { address, balance }
}
@@ -36,7 +36,7 @@ impl<A: Address> Payment<A> {
&self.address
}
/// The balance to transfer.
pub fn balance(&self) -> Balance {
pub fn balance(&self) -> ExternalBalance {
self.balance
}
@@ -44,7 +44,7 @@ impl<A: Address> Payment<A> {
pub fn read(reader: &mut impl io::Read) -> io::Result<Self> {
let address = A::deserialize_reader(reader)?;
let reader = &mut IoReader(reader);
let balance = Balance::decode(reader).map_err(io::Error::other)?;
let balance = ExternalBalance::decode(reader).map_err(io::Error::other)?;
Ok(Self { address, balance })
}
/// Write the Payment.