Skip to content

Commit

Permalink
Adding test for is_bip30_unspendable
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerson2102 committed Sep 19, 2024
1 parent 9be3fd4 commit 91c8918
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion packages/consensus/src/validation/coinbase.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ mod tests {
use super::{
compute_block_reward, validate_coinbase, validate_coinbase_input,
validate_coinbase_sig_script, validate_coinbase_witness, validate_coinbase_outputs,
calculate_wtxid_commitment
calculate_wtxid_commitment, is_bip30_unspendable
};
use utils::{hex::{from_hex, hex_to_hash_rev}, hash::Digest};

Expand Down Expand Up @@ -660,5 +660,23 @@ mod tests {

validate_coinbase(@tx, total_fees, block_height, wtxid_root_hash).unwrap();
}

#[test]
fn test_is_bip30_unspendable() {
let block_height = 91722;
let result = is_bip30_unspendable(block_height);

assert_eq!(result, true);

let block_height = 91812;
let result = is_bip30_unspendable(block_height);

assert_eq!(result, true);

let block_height = 9;
let result = is_bip30_unspendable(block_height);

assert_eq!(result, false);
}
}

0 comments on commit 91c8918

Please sign in to comment.