Skip to content

Commit

Permalink
Merge pull request nervosnetwork#4493 from libraries/fix_fuzz
Browse files Browse the repository at this point in the history
script(fuzz): fixed the issue where data1 verifier always returns invalid version error
  • Loading branch information
doitian authored Jun 25, 2024
2 parents 247befe + 33ac0ae commit eece5d0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use ckb_types::{
core::{
capacity_bytes,
cell::{CellMetaBuilder, ResolvedTransaction},
hardfork::{HardForks, CKB2021, CKB2023},
Capacity, HeaderView, ScriptHashType, TransactionBuilder, TransactionInfo,
},
h256,
Expand Down Expand Up @@ -96,7 +97,13 @@ fn run(data: &[u8]) {
};

let provider = MockDataLoader {};
let consensus = ConsensusBuilder::default().build();
let hardfork_switch = HardForks {
ckb2021: CKB2021::new_dev_default(),
ckb2023: CKB2023::new_dev_default(),
};
let consensus = ConsensusBuilder::default()
.hardfork_switch(hardfork_switch)
.build();
let tx_verify_env =
TxVerifyEnv::new_submit(&HeaderView::new_advanced_builder().epoch(0.pack()).build());
let verifier = TransactionScriptsVerifier::new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use ckb_types::{
core::{
capacity_bytes,
cell::{CellMetaBuilder, ResolvedTransaction},
hardfork::{HardForks, CKB2021, CKB2023},
Capacity, HeaderView, ScriptHashType, TransactionBuilder, TransactionInfo,
},
h256,
Expand Down Expand Up @@ -96,7 +97,13 @@ fn run(data: &[u8]) {
};

let provider = MockDataLoader {};
let consensus = ConsensusBuilder::default().build();
let hardfork_switch = HardForks {
ckb2021: CKB2021::new_dev_default(),
ckb2023: CKB2023::new_dev_default(),
};
let consensus = ConsensusBuilder::default()
.hardfork_switch(hardfork_switch)
.build();
let tx_verify_env =
TxVerifyEnv::new_submit(&HeaderView::new_advanced_builder().epoch(0.pack()).build());
let verifier = TransactionScriptsVerifier::new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,8 @@ fn run(data: &[u8]) {

let provider = MockDataLoader {};
let hardfork_switch = HardForks {
ckb2021: CKB2021::new_mirana().as_builder().build().unwrap(),
ckb2023: CKB2023::new_mirana()
.as_builder()
.rfc_0049(0)
.build()
.unwrap(),
ckb2021: CKB2021::new_dev_default(),
ckb2023: CKB2023::new_dev_default(),
};
let consensus = ConsensusBuilder::default()
.hardfork_switch(hardfork_switch)
Expand Down

0 comments on commit eece5d0

Please sign in to comment.