Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_labels.py
Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | def _run_subtest(self, accounts_api, node): | ||||
label.verify(node) | label.verify(node) | ||||
# Check the amounts received. | # Check the amounts received. | ||||
node.generate(1) | node.generate(1) | ||||
for label in labels: | for label in labels: | ||||
assert_equal( | assert_equal( | ||||
node.getreceivedbyaddress(label.addresses[0]), amount_to_send) | node.getreceivedbyaddress(label.addresses[0]), amount_to_send) | ||||
assert_equal(node.getreceivedbylabel(label.name), amount_to_send) | assert_equal(node.getreceivedbylabel(label.name), amount_to_send) | ||||
jasonbcox: The missing change from the PR is due to D1799 | |||||
# Check that sendfrom label reduces listaccounts balances. | # Check that sendfrom label reduces listaccounts balances. | ||||
for i, label in enumerate(labels): | for i, label in enumerate(labels): | ||||
to_label = labels[(i + 1) % len(labels)] | to_label = labels[(i + 1) % len(labels)] | ||||
if accounts_api: | if accounts_api: | ||||
node.sendfrom( | node.sendfrom( | ||||
label.name, to_label.receive_address, amount_to_send) | label.name, to_label.receive_address, amount_to_send) | ||||
else: | else: | ||||
node.sendfrom( | node.sendtoaddress(to_label.addresses[0], amount_to_send) | ||||
label.name, to_label.addresses[0], amount_to_send) | |||||
node.generate(1) | node.generate(1) | ||||
for label in labels: | for label in labels: | ||||
if accounts_api: | if accounts_api: | ||||
address = node.getaccountaddress(label.name) | address = node.getaccountaddress(label.name) | ||||
else: | else: | ||||
address = node.getnewaddress(label.name) | address = node.getnewaddress(label.name) | ||||
label.add_receive_address(address) | label.add_receive_address(address) | ||||
label.verify(node) | label.verify(node) | ||||
Show All 26 Lines | def _run_subtest(self, accounts_api, node): | ||||
addresses = [] | addresses = [] | ||||
for x in range(10): | for x in range(10): | ||||
addresses.append(node.getnewaddress()) | addresses.append(node.getnewaddress()) | ||||
multisig_address = node.addmultisigaddress( | multisig_address = node.addmultisigaddress( | ||||
5, addresses, label.name)['address'] | 5, addresses, label.name)['address'] | ||||
label.add_address(multisig_address) | label.add_address(multisig_address) | ||||
label.purpose[multisig_address] = "send" | label.purpose[multisig_address] = "send" | ||||
label.verify(node) | label.verify(node) | ||||
if accounts_api: | |||||
node.sendfrom("", multisig_address, 50) | node.sendfrom("", multisig_address, 50) | ||||
node.generate(101) | node.generate(101) | ||||
if accounts_api: | if accounts_api: | ||||
for label in labels: | for label in labels: | ||||
assert_equal(node.getbalance(label.name), 50) | assert_equal(node.getbalance(label.name), 50) | ||||
# Check that setlabel can change the label of an address from a | # Check that setlabel can change the label of an address from a | ||||
# different label. | # different label. | ||||
change_label(node, labels[0].addresses[0], | change_label(node, labels[0].addresses[0], | ||||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |
The missing change from the PR is due to D1799