2019-12-04 07:29:16 -08:00
|
|
|
#!/usr/bin/env python3
|
2018-09-21 11:10:15 -07:00
|
|
|
# Copyright (c) 2018 The Zcash developers
|
|
|
|
# Distributed under the MIT software license, see the accompanying
|
2019-07-18 07:16:09 -07:00
|
|
|
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
|
2018-09-21 11:10:15 -07:00
|
|
|
|
|
|
|
from test_framework.test_framework import BitcoinTestFramework
|
2019-07-19 05:10:13 -07:00
|
|
|
from test_framework.util import wait_and_assert_operationid_status
|
2018-09-21 11:10:15 -07:00
|
|
|
|
|
|
|
class RegtestSignrawtransactionTest (BitcoinTestFramework):
|
|
|
|
|
|
|
|
def run_test(self):
|
|
|
|
self.nodes[0].generate(1)
|
|
|
|
self.sync_all()
|
|
|
|
taddr = self.nodes[1].getnewaddress()
|
|
|
|
zaddr1 = self.nodes[1].z_getnewaddress('sprout')
|
|
|
|
|
|
|
|
self.nodes[0].sendtoaddress(taddr, 2.0)
|
|
|
|
self.nodes[0].generate(1)
|
|
|
|
self.sync_all()
|
|
|
|
|
2019-07-19 05:10:13 -07:00
|
|
|
# Create and sign Sapling transaction.
|
2018-09-21 11:10:15 -07:00
|
|
|
# If the incorrect consensus branch id is selected, there will be a signing error.
|
|
|
|
opid = self.nodes[1].z_sendmany(taddr,
|
|
|
|
[{'address': zaddr1, 'amount': 1}])
|
|
|
|
wait_and_assert_operationid_status(self.nodes[1], opid)
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
RegtestSignrawtransactionTest().main()
|