For #3359. Return error if Sapling addresses passed to RPC z_mergetoaddress.

RPC z_mergetoaddress does not support Sapling yet but the existing error
reporting was not clear to users.
This commit is contained in:
Simon
2018-10-13 08:10:10 -07:00
parent de1b86a429
commit 61caa46619
2 changed files with 39 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ class WalletSaplingTest(BitcoinTestFramework):
return start_nodes(4, self.options.tmpdir, [[
'-nuparams=5ba81b19:201', # Overwinter
'-nuparams=76b809bb:203', # Sapling
'-experimentalfeatures', '-zmergetoaddress',
]] * 4)
def run_test(self):
@@ -53,6 +54,18 @@ class WalletSaplingTest(BitcoinTestFramework):
except JSONRPCException as e:
assert_equal("Invalid parameter, Sapling has not activated", e.error['message'])
# Verify z_mergetoaddress RPC does not support Sapling yet
try:
self.nodes[3].z_mergetoaddress([tmp_taddr], tmp_zaddr)
raise AssertionError("Should have thrown an exception")
except JSONRPCException as e:
assert_equal("Invalid parameter, Sapling is not supported yet by z_mergetoadress", e.error['message'])
try:
self.nodes[3].z_mergetoaddress([tmp_zaddr], tmp_taddr)
raise AssertionError("Should have thrown an exception")
except JSONRPCException as e:
assert_equal("Invalid parameter, Sapling is not supported yet by z_mergetoadress", e.error['message'])
# Activate Sapling
self.nodes[2].generate(2)
self.sync_all()