mirror of
https://github.com/aljazceru/cdk.git
synced 2026-02-02 11:45:51 +01:00
fix: itest change ordering
This commit is contained in:
@@ -355,6 +355,15 @@ async fn test_fake_melt_change_in_quote() -> Result<()> {
|
||||
|
||||
let check = wallet.melt_quote_status(&melt_quote.id).await?;
|
||||
|
||||
assert_eq!(melt_response.change, check.change);
|
||||
assert_eq!(
|
||||
melt_response
|
||||
.change
|
||||
.unwrap()
|
||||
.sort_by(|a, b| a.amount.cmp(&b.amount)),
|
||||
check
|
||||
.change
|
||||
.unwrap()
|
||||
.sort_by(|a, b| a.amount.cmp(&b.amount))
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -146,6 +146,18 @@ pub struct BlindSignature {
|
||||
pub dleq: Option<BlindSignatureDleq>,
|
||||
}
|
||||
|
||||
impl Ord for BlindSignature {
|
||||
fn cmp(&self, other: &Self) -> Ordering {
|
||||
self.amount.cmp(&other.amount)
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialOrd for BlindSignature {
|
||||
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
||||
Some(self.cmp(other))
|
||||
}
|
||||
}
|
||||
|
||||
/// Witness
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
|
||||
@@ -48,7 +48,7 @@ pub enum Error {
|
||||
}
|
||||
|
||||
/// Keyset version
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub enum KeySetVersion {
|
||||
/// Current Version 00
|
||||
Version00,
|
||||
@@ -83,7 +83,7 @@ impl fmt::Display for KeySetVersion {
|
||||
/// anyone who knows the set of public keys of a mint. The keyset ID **CAN**
|
||||
/// be stored in a Cashu token such that the token can be used to identify
|
||||
/// which mint or keyset it was generated from.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct Id {
|
||||
version: KeySetVersion,
|
||||
id: [u8; Self::BYTELEN],
|
||||
|
||||
@@ -76,7 +76,7 @@ done
|
||||
|
||||
|
||||
# Run cargo test
|
||||
cargo test -p cdk-integration-tests --test fake_wallet "test_fake_melt_change_in_quote"
|
||||
cargo test -p cdk-integration-tests --test fake_wallet
|
||||
# cargo test -p cdk-integration-tests --test mint
|
||||
|
||||
# Capture the exit status of cargo test
|
||||
|
||||
Reference in New Issue
Block a user