Skip to content

Commit e5b8dba

Browse files
committed
Tests: Update sapling_malleable-sigs test, now failing
1 parent cee6ef3 commit e5b8dba

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

test/functional/sapling_malleable_sigs.py

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
)
1212
from 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

test/functional/test_runner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
'sapling_mempool.py', # ~ 98 sec
155155
'sapling_wallet_persistence.py', # ~ 90 sec
156156
'sapling_supply.py', # ~ 58 sec
157+
'sapling_malleable_sigs.py', # ~ 44 sec
157158
]
158159

159160
EXTENDED_SCRIPTS = [

0 commit comments

Comments
 (0)