@@ -403,6 +403,7 @@ fn arithmetic_pow_neg() {
403403/// Error: [`RuntimeError::Arithmetic`]
404404/// Caused by: calling nlogn with n = 0
405405/// Outcome: block accepted.
406+ /// Note: Returns a [`clarity::vm::analysis::CheckErrorKind::CostComputationFailed`] which wrapps the underlying [`RuntimeError::Arithmetic`] error.
406407#[ test]
407408fn arithmetic_zero_n_log_n ( ) {
408409 contract_call_consensus_test ! (
@@ -614,6 +615,7 @@ fn defunct_pox_contracts() {
614615 let mut blocks = vec ! [ ] ;
615616 // Attempt to mine each transaction in a diff block
616617 for tx in [
618+ // These pox lockups should fail
617619 make_pox_lockup (
618620 & sender_sk,
619621 nonce,
@@ -639,6 +641,7 @@ fn defunct_pox_contracts() {
639641 lock_period,
640642 height,
641643 ) ,
644+ // This final lockup should succeed until we upgrade our pox contract
642645 make_pox_4_lockup (
643646 & sender_sk,
644647 nonce + 3 ,
@@ -664,90 +667,6 @@ fn defunct_pox_contracts() {
664667 insta:: assert_ron_snapshot!( results) ;
665668}
666669
667- /// Error: ERR_STACKING_ALREADY_STACKED
668- /// Caused by: calling `stack-stx` when the caller already has an active lock.
669- /// Outcome: block accepted
670- #[ test]
671- fn pox_already_locked ( ) {
672- assert_eq ! (
673- StacksEpochId :: latest( ) ,
674- StacksEpochId :: Epoch33 ,
675- "Test may need to update its pox contract call"
676- ) ;
677- let sender_sk = StacksPrivateKey :: from_hex ( SK_1 ) . unwrap ( ) ;
678- let address = to_addr ( & sender_sk) ;
679- let principal: PrincipalData = address. clone ( ) . into ( ) ;
680- let hash_mode = AddressHashMode :: SerializeP2PKH ;
681- let addr_bytes = address. bytes ( ) ;
682- let pox_address = PoxAddress :: from_legacy ( hash_mode, addr_bytes. clone ( ) ) ;
683- let signer_key = StacksPublicKey :: from_private ( & sender_sk) ;
684- let mut nonce = 0 ;
685-
686- let lock_amount = TestStacker :: DEFAULT_STACKER_AMOUNT ;
687- let addr_bytes = address. bytes ( ) ;
688- let lock_period = 1 ;
689- let auth_id = 1 ;
690-
691- // Height can be bogus; this test is not testing validity of cycle alignment.
692- let height = 0 ;
693-
694- let initial_balances = vec ! [ ( principal. clone( ) , u64 :: try_from( lock_amount) . unwrap( ) * 2 ) ] ;
695-
696- let signature = make_signer_key_signature (
697- & pox_address,
698- & sender_sk,
699- 6 ,
700- & Pox4SignatureTopic :: StackStx ,
701- 1 ,
702- u128:: MAX ,
703- auth_id,
704- ) ;
705-
706- // First transaction: succeeds → lock is created.
707- let tx1 = make_pox_4_lockup (
708- & sender_sk,
709- nonce,
710- lock_amount,
711- & pox_address,
712- 1 ,
713- & signer_key,
714- 48 ,
715- Some ( signature. clone ( ) ) ,
716- u128:: MAX ,
717- auth_id,
718- ) ;
719- nonce += 1 ;
720-
721- // Second transaction: *same address, overlapping period* → ERR_STACKING_ALREADY_STACKED.
722- let tx2 = make_pox_4_lockup (
723- & sender_sk,
724- nonce,
725- lock_amount,
726- & pox_address,
727- 1 ,
728- & signer_key,
729- 48 ,
730- Some ( signature) ,
731- u128:: MAX ,
732- auth_id,
733- ) ;
734-
735- let blocks = vec ! [
736- TestBlock {
737- transactions: vec![ tx1] ,
738- } ,
739- TestBlock {
740- transactions: vec![ tx2] ,
741- } ,
742- ] ;
743-
744- let epoch_blocks = HashMap :: from ( [ ( StacksEpochId :: latest ( ) , blocks) ] ) ;
745-
746- let results = ConsensusTest :: new ( function_name ! ( ) , initial_balances, epoch_blocks) . run ( ) ;
747-
748- insta:: assert_ron_snapshot!( results) ;
749- }
750-
751670/// Error: [`RuntimeError::BlockTimeNotAvailable`]
752671/// Caused by: attempting to retrieve the stacks-block-time from a pre-3.3 height
753672/// Outcome: block accepted
0 commit comments