@@ -692,10 +692,7 @@ async def test_double_spend_with_higher_fee(
692692
693693 @pytest .mark .anyio
694694 async def test_invalid_signature (
695- self ,
696- one_node_one_block : tuple [FullNodeSimulator , ChiaServer , BlockTools ],
697- wallet_a : WalletTool ,
698- caplog : pytest .LogCaptureFixture ,
695+ self , one_node_one_block : tuple [FullNodeSimulator , ChiaServer , BlockTools ], wallet_a : WalletTool
699696 ) -> None :
700697 reward_ph = wallet_a .get_new_puzzlehash ()
701698
@@ -719,12 +716,11 @@ async def test_invalid_signature(
719716 sb : SpendBundle = generate_test_spend_bundle (wallet_a , coin1 )
720717 assert sb .aggregated_signature != G2Element .generator ()
721718 sb = sb .replace (aggregated_signature = G2Element .generator ())
722- caplog .clear ()
723719 res : Optional [Message ] = await send_sb (full_node_1 , sb )
724720 assert res is not None
725721 ack : TransactionAck = TransactionAck .from_bytes (res .data )
726- assert ack .status != MempoolInclusionStatus .SUCCESS .value
727- assert "chia.util.errors.ValidationError: Error code: BAD_AGGREGATE_SIGNATURE" in caplog . text
722+ assert ack .status == MempoolInclusionStatus .FAILED .value
723+ assert ack . error == Err . BAD_AGGREGATE_SIGNATURE . name
728724 invariant_check_mempool (full_node_1 .full_node .mempool_manager .mempool )
729725
730726 async def condition_tester (
@@ -2872,11 +2868,9 @@ async def test_invalid_coin_spend_coin(
28722868 coin_spend_0 = make_spend (coin_0 , cs .puzzle_reveal , cs .solution )
28732869 new_bundle = recursive_replace (spend_bundle , "coin_spends" , [coin_spend_0 , * spend_bundle .coin_spends [1 :]])
28742870 assert spend_bundle is not None
2875- try :
2876- res = await full_node_1 .full_node .add_transaction (new_bundle , new_bundle .name (), test = True )
2877- except ValidationError as e :
2878- res = (MempoolInclusionStatus .FAILED , e .code )
2879- assert res == (MempoolInclusionStatus .FAILED , Err .WRONG_PUZZLE_HASH )
2871+ with pytest .raises (ValidationError ) as e :
2872+ await full_node_1 .full_node .add_transaction (new_bundle , new_bundle .name (), test = True )
2873+ assert e .value .code == Err .WRONG_PUZZLE_HASH
28802874
28812875
28822876coins = make_test_coins ()
0 commit comments