From 2e587084b425fd270b5ca3eff08b95ad7924f5ea Mon Sep 17 00:00:00 2001 From: Roman Date: Sat, 15 Jun 2024 09:02:37 +0200 Subject: [PATCH] test: add coin value check --- ledger/cryptarchia-ledger/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ledger/cryptarchia-ledger/src/lib.rs b/ledger/cryptarchia-ledger/src/lib.rs index 9aacae48..2a954cba 100644 --- a/ledger/cryptarchia-ledger/src/lib.rs +++ b/ledger/cryptarchia-ledger/src/lib.rs @@ -386,7 +386,7 @@ impl core::fmt::Debug for LedgerState { #[cfg(test)] pub mod tests { - use super::{Coin, EpochState, LeaderProof, Ledger, LedgerState, Nullifier}; + use super::{Coin, EpochState, LeaderProof, Ledger, LedgerState, Nullifier, Value}; use crate::{crypto::Blake2b, Commitment, Config, LedgerError}; use blake2::Digest; use cryptarchia_engine::Slot; @@ -810,6 +810,8 @@ pub mod tests { .try_apply_proof::(&proof, ledger_config) .err(); + assert_eq!(coin.value(), Value::from(1u32)); + // Commitment cannot be spent twice assert!( matches!(apply_proof_err, Some(LedgerError::CommitmentExists)),