Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-segwit-recovery.py
Show First 20 Lines • Show All 248 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# Create segwit funding and spending transactions | # Create segwit funding and spending transactions | ||||
txfund, txspend = create_segwit_fund_and_spend_tx(out[0]) | txfund, txspend = create_segwit_fund_and_spend_tx(out[0]) | ||||
txfund_case0, txspend_case0 = create_segwit_fund_and_spend_tx( | txfund_case0, txspend_case0 = create_segwit_fund_and_spend_tx( | ||||
out[1], True) | out[1], True) | ||||
# Mine txfund, as it can't go into node_std mempool because it's | # Mine txfund, as it can't go into node_std mempool because it's | ||||
# nonstandard. | # nonstandard. | ||||
b = block(5555) | block(5555) | ||||
update_block(5555, [txfund, txfund_case0]) | update_block(5555, [txfund, txfund_case0]) | ||||
accepted(node_nonstd) | accepted(node_nonstd) | ||||
# Check both nodes are synchronized before continuing. | # Check both nodes are synchronized before continuing. | ||||
sync_blocks(self.nodes) | sync_blocks(self.nodes) | ||||
# Check that upgraded nodes checking for standardness are not banning | # Check that upgraded nodes checking for standardness are not banning | ||||
# nodes sending segwit spending txns. | # nodes sending segwit spending txns. | ||||
Show All 14 Lines | def run_test(self): | ||||
node_nonstd.sendrawtransaction, ToHex(txspend_case0)) | node_nonstd.sendrawtransaction, ToHex(txspend_case0)) | ||||
assert_raises_rpc_error(-26, RPC_CLEANSTACK_ERROR, | assert_raises_rpc_error(-26, RPC_CLEANSTACK_ERROR, | ||||
node_std.sendrawtransaction, ToHex(txspend)) | node_std.sendrawtransaction, ToHex(txspend)) | ||||
assert_raises_rpc_error(-26, RPC_EVAL_FALSE_ERROR, | assert_raises_rpc_error(-26, RPC_EVAL_FALSE_ERROR, | ||||
node_std.sendrawtransaction, ToHex(txspend_case0)) | node_std.sendrawtransaction, ToHex(txspend_case0)) | ||||
# Blocks containing segwit spending txns are accepted in both nodes. | # Blocks containing segwit spending txns are accepted in both nodes. | ||||
block(5) | block(5) | ||||
postforkblock = update_block(5, [txspend, txspend_case0]) | update_block(5, [txspend, txspend_case0]) | ||||
accepted(node_nonstd) | accepted(node_nonstd) | ||||
sync_blocks(self.nodes) | sync_blocks(self.nodes) | ||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
SegwitRecoveryTest().main() | SegwitRecoveryTest().main() |