Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-wallet-standardness.py
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
assert_equal(scriptPubKey, signedtx.vout[0].scriptPubKey) | assert_equal(scriptPubKey, signedtx.vout[0].scriptPubKey) | ||||
txid = signedtx.rehash() | txid = signedtx.rehash() | ||||
balance_initial = std_node.getbalance() | balance_initial = std_node.getbalance() | ||||
# try broadcasting it on the standard node | # try broadcasting it on the standard node | ||||
if shouldBeStandard: | if shouldBeStandard: | ||||
std_node.sendrawtransaction(rawtx) | std_node.sendrawtransaction(rawtx) | ||||
assert txid in std_node.getrawmempool() | |||||
else: | else: | ||||
assert_raises_rpc_error(-26, nonstd_error, | assert_raises_rpc_error(-26, nonstd_error, | ||||
std_node.sendrawtransaction, rawtx) | std_node.sendrawtransaction, rawtx) | ||||
assert txid not in std_node.getrawmempool() | |||||
# make sure it's in nonstandard node's mempool, then mine it | # make sure it's in nonstandard node's mempool, then mine it | ||||
nonstd_node.sendrawtransaction(rawtx) | nonstd_node.sendrawtransaction(rawtx) | ||||
assert txid in nonstd_node.getrawmempool() | assert txid in nonstd_node.getrawmempool() | ||||
[blockhash] = nonstd_node.generate(1) | [blockhash] = nonstd_node.generate(1) | ||||
# make sure it was mined | # make sure it was mined | ||||
assert txid in nonstd_node.getblock(blockhash)["tx"] | assert txid in nonstd_node.getblock(blockhash)["tx"] | ||||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |