Skip to content

Commit 2c687e0

Browse files
committed
chore: add test cases for handle_mint without issuer vkey
1 parent b356cd7 commit 2c687e0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

modules/epochs_state/src/state.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,22 @@ mod tests {
346346
);
347347
}
348348

349+
#[test]
350+
fn handle_mint_without_issuer() {
351+
let mut state = State::new(&GenesisValues::mainnet());
352+
let mut block = make_block(100);
353+
state.handle_mint(&block, None);
354+
block.number += 1;
355+
state.handle_mint(&block, None);
356+
357+
assert_eq!(state.epoch_blocks, 2);
358+
assert_eq!(state.blocks_minted.len(), 0);
359+
assert_eq!(
360+
state.blocks_minted.get(&keyhash_224(b"issuer").into()),
361+
None
362+
);
363+
}
364+
349365
#[test]
350366
fn handle_mint_multiple_issuer_records_counts() {
351367
let mut state = State::new(&GenesisValues::mainnet());

0 commit comments

Comments
 (0)