1111)
1212from test_framework .util import (
1313 assert_equal ,
14- assert_greater_than ,
14+ assert_raises_rpc_error ,
1515 bytes_to_hex_str ,
1616 hex_str_to_bytes ,
1717)
@@ -31,9 +31,6 @@ def run_test(self):
3131 node .generate (2 )
3232 assert_equal (node .getblockcount (), 202 )
3333
34- t_balance = node .getbalance ()
35- z_balance = node .getshieldedbalance ()
36-
3734 z_addr = node .getnewshieldedaddress ()
3835 shield_to = [{"address" : z_addr , "amount" : Decimal ('10' )}]
3936
@@ -49,24 +46,9 @@ def run_test(self):
4946 new_tx .sapData = b""
5047 new_rawtx = bytes_to_hex_str (new_tx .serialize ())
5148 self .log .info ("Sending malleated tx..." )
52- txid = node .sendrawtransaction (new_rawtx , True )
53- assert (txid is not None )
54- self .log .info ("Tx accepted in mempool" )
55-
56- # No notes minted
57- assert_equal (node .getshieldedbalance (), z_balance )
58- # But 10 PIV have been effectively burned
59- fee = - Decimal (node .gettransaction (txid )['fee' ])
60- assert_greater_than (fee , Decimal ('10' ))
61- assert_equal (node .getbalance (), t_balance - fee )
62-
63- hashes = node .generate (1 )
64- assert_equal (len (hashes ), 1 )
65- chain_tx = node .gettransaction (txid )
66- assert_equal (chain_tx ['confirmations' ], 1 )
67- self .log .info ("Malleated Tx accepted on chain" )
68-
69-
49+ assert_raises_rpc_error (- 26 , "mandatory-script-verify-flag-failed" ,
50+ node .sendrawtransaction , new_rawtx , True )
51+ self .log .info ("Good. Tx NOT accepted in mempool" )
7052
7153
7254
0 commit comments