zcash/qa/rpc-tests/mergetoaddress_ua_nu5.py

36 lines
1.4 KiB
Python
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python3
# Copyright (c) 2023 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import NU5_BRANCH_ID, nuparams
from mergetoaddress_helper import MergeToAddressHelper
def get_new_address(test, node):
account = test.nodes[node].z_getnewaccount()['account']
# TODO: Since we cant merge from Orchard, the existing tests dont work if we merge _to_
# Orchard, so exclude it from the UA for now.
return test.nodes[node].z_getaddressforaccount(account, ['p2pkh', 'sapling'])['address']
class MergeToAddressUANU5 (BitcoinTestFramework):
# TODO: Until we can merge from Orchard, we just use 'ANY_SAPLING' as the wildcard here, since
# we dont have an `'ANY_ORCHARD'` yet and `'ANY_SPROUT'` isnt compatible with Orchard.
helper = MergeToAddressHelper(get_new_address, 'ANY_SAPLING')
def setup_chain(self):
self.helper.setup_chain(self)
def setup_network(self, split=False):
self.helper.setup_network(self, [
'-anchorconfirmations=1',
nuparams(NU5_BRANCH_ID, 109),
])
def run_test(self):
self.helper.run_test(self)
if __name__ == '__main__':
MergeToAddressUANU5().main()