test: add coin value check
This commit is contained in:
parent
30b528f421
commit
2e587084b4
|
@ -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)),
|
||||
|
|
Loading…
Reference in New Issue