File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
testnet/stacks-node/src/tests Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -8614,6 +8614,38 @@ pub fn make_random_tx_chain(
86148614 chain
86158615}
86168616
8617+ fn make_mblock_tx_chain ( privk : & StacksPrivateKey , fee_plus : u64 , chain_id : u32 ) -> Vec < Vec < u8 > > {
8618+ let addr = to_addr ( privk) ;
8619+ let mut chain = vec ! [ ] ;
8620+
8621+ for nonce in 0 ..25 {
8622+ // N.B. private keys are 32-33 bytes, so this is always safe
8623+ let random_iters = privk. to_bytes ( ) [ nonce as usize ] as usize ;
8624+
8625+ let be_bytes = [
8626+ privk. to_bytes ( ) [ nonce as usize ] ,
8627+ privk. to_bytes ( ) [ ( nonce + 1 ) as usize ] ,
8628+ ] ;
8629+
8630+ let random_extra_fee = u16:: from_be_bytes ( be_bytes) as u64 ;
8631+
8632+ let mut addr_prefix = addr. to_string ( ) ;
8633+ let _ = addr_prefix. split_off ( 12 ) ;
8634+ let contract_name = format ! ( "crct-{nonce}-{addr_prefix}-{random_iters}" ) ;
8635+ eprintln ! ( "Make tx {contract_name}" ) ;
8636+ let tx = make_contract_publish_microblock_only (
8637+ privk,
8638+ nonce,
8639+ 1049230 + nonce + fee_plus + random_extra_fee,
8640+ chain_id,
8641+ & contract_name,
8642+ & make_runtime_sized_contract ( 1 , nonce, & addr_prefix) ,
8643+ ) ;
8644+ chain. push ( tx) ;
8645+ }
8646+ chain
8647+ }
8648+
86178649fn test_competing_miners_build_on_same_chain (
86188650 num_miners : usize ,
86198651 conf_template : Config ,
You can’t perform that action at this time.
0 commit comments