Compare commits
2 Commits
30b528f421
...
6aba4d6fd7
Author | SHA1 | Date |
---|---|---|
Roman | 6aba4d6fd7 | |
Roman | 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;
|
||||
|
@ -803,8 +803,12 @@ pub mod tests {
|
|||
let proof = LeaderProof::dummy(actual_slot, commitment, commitment);
|
||||
let epoch_state = ledger_state.epoch_state();
|
||||
|
||||
assert_eq!(ledger_state.can_lead(&commitment), true);
|
||||
assert_eq!(epoch_state.is_eligible_leader(&commitment), true);
|
||||
assert!(ledger_state.can_spend(&commitment));
|
||||
assert_eq!(epoch_state.total_stake(), Value::from(1u32));
|
||||
assert_eq!(coin.value(), Value::from(1u32));
|
||||
|
||||
assert!(ledger_state.can_lead(&commitment));
|
||||
assert!(epoch_state.is_eligible_leader(&commitment));
|
||||
|
||||
let apply_proof_err = ledger_state
|
||||
.try_apply_proof::<HeaderId>(&proof, ledger_config)
|
||||
|
|
Loading…
Reference in New Issue