Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc_wallet_standardness.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2019 The Bitcoin developers | # Copyright (c) 2019 The Bitcoin developers | ||||
# Distributed under the MIT software license, see the accompanying | # Distributed under the MIT software license, see the accompanying | ||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
"""Test the response of wallet to a variety of weird / nonstandard coins | """Test the response of wallet to a variety of weird / nonstandard coins | ||||
that it might try to spend.""" | that it might try to spend.""" | ||||
from decimal import Decimal | from decimal import Decimal | ||||
from test_framework.messages import ( | |||||
CTransaction, | from test_framework.messages import CTransaction, CTxOut, FromHex, ToHex | ||||
CTxOut, | |||||
FromHex, | |||||
ToHex, | |||||
) | |||||
from test_framework.script import ( | from test_framework.script import ( | ||||
CScript, | |||||
OP_1, | OP_1, | ||||
OP_5, | OP_5, | ||||
OP_CHECKSIG, | |||||
OP_CHECKMULTISIG, | OP_CHECKMULTISIG, | ||||
OP_CHECKSIG, | |||||
OP_DUP, | OP_DUP, | ||||
OP_EQUALVERIFY, | OP_EQUALVERIFY, | ||||
OP_HASH160, | OP_HASH160, | ||||
OP_PUSHDATA1, | OP_PUSHDATA1, | ||||
CScript, | |||||
hash160, | hash160, | ||||
) | ) | ||||
from test_framework.test_framework import BitcoinTestFramework | from test_framework.test_framework import BitcoinTestFramework | ||||
from test_framework.util import ( | from test_framework.util import assert_equal, assert_raises_rpc_error | ||||
assert_raises_rpc_error, | |||||
assert_equal, | |||||
) | |||||
SATOSHI = Decimal('0.01') | SATOSHI = Decimal('0.01') | ||||
class WalletStandardnessTest(BitcoinTestFramework): | class WalletStandardnessTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.setup_clean_chain = True | self.setup_clean_chain = True | ||||
self.num_nodes = 2 | self.num_nodes = 2 | ||||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |