test: add coin value check

This commit is contained in:
Roman 2024-06-15 09:02:37 +02:00
parent 30b528f421
commit 2e587084b4
No known key found for this signature in database
GPG Key ID: B8FE070B54E11B75
1 changed files with 3 additions and 1 deletions

View File

@ -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::<HeaderId>(&proof, ledger_config)
.err();
assert_eq!(coin.value(), Value::from(1u32));
// Commitment cannot be spent twice
assert!(
matches!(apply_proof_err, Some(LedgerError::CommitmentExists)),