Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_rawtransaction.py
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# An invalid block hash should raise the correct errors | # An invalid block hash should raise the correct errors | ||||
assert_raises_rpc_error(-8, "parameter 3 must be hexadecimal", | assert_raises_rpc_error(-8, "parameter 3 must be hexadecimal", | ||||
self.nodes[0].getrawtransaction, tx, True, True) | self.nodes[0].getrawtransaction, tx, True, True) | ||||
assert_raises_rpc_error(-8, "parameter 3 must be hexadecimal", | assert_raises_rpc_error(-8, "parameter 3 must be hexadecimal", | ||||
self.nodes[0].getrawtransaction, tx, True, "foobar") | self.nodes[0].getrawtransaction, tx, True, "foobar") | ||||
assert_raises_rpc_error(-8, "parameter 3 must be of length 64", | assert_raises_rpc_error(-8, "parameter 3 must be of length 64", | ||||
self.nodes[0].getrawtransaction, tx, True, "abcd1234") | self.nodes[0].getrawtransaction, tx, True, "abcd1234") | ||||
assert_raises_rpc_error(-5, "Block hash not found", self.nodes[0].getrawtransaction, | assert_raises_rpc_error(-5, "Block hash not found", self.nodes[0].getrawtransaction, | ||||
tx, True, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") | tx, True, "0000000000000000000000000000000000000000000000000000000000000000") | ||||
# Undo the blocks and check in_active_chain | |||||
self.nodes[0].invalidateblock(block1) | |||||
gottx = self.nodes[0].getrawtransaction( | |||||
txid=tx, verbose=True, blockhash=block1) | |||||
assert_equal(gottx['in_active_chain'], False) | |||||
self.nodes[0].reconsiderblock(block1) | |||||
assert_equal(self.nodes[0].getbestblockhash(), block2) | |||||
# | # | ||||
# RAW TX MULTISIG TESTS # | # RAW TX MULTISIG TESTS # | ||||
# | # | ||||
# 2of2 test | # 2of2 test | ||||
addr1 = self.nodes[2].getnewaddress() | addr1 = self.nodes[2].getnewaddress() | ||||
addr2 = self.nodes[2].getnewaddress() | addr2 = self.nodes[2].getnewaddress() | ||||
▲ Show 20 Lines • Show All 233 Lines • Show Last 20 Lines |