You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
strUsage += HelpMessageOpt("-addresstype", strprintf(_("What type of addresses to use (\"legacy\", \"p2sh-segwit\", or \"bech32\", default: \"%s\")"), FormatOutputType(OUTPUT_TYPE_DEFAULT)));
20
-
strUsage += HelpMessageOpt("-changetype", _("What type of change to use (\"legacy\", \"p2sh-segwit\", or \"bech32\", default is same as -addresstype)"));
20
+
strUsage += HelpMessageOpt("-changetype", _("What type of change to use (\"legacy\", \"p2sh-segwit\", or \"bech32\"). Default is same as -addresstype, except when -addresstype=p2sh-segwit a native segwit output is used when sending to a native segwit address)"));
21
21
strUsage += HelpMessageOpt("-disablewallet", _("Do not load the wallet and disable wallet RPC calls"));
22
22
strUsage += HelpMessageOpt("-keypool=<n>", strprintf(_("Set key pool size to <n> (default: %u)"), DEFAULT_KEYPOOL_SIZE));
23
23
strUsage += HelpMessageOpt("-fallbackfee=<amt>", strprintf(_("A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)"),
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
5
"""Test that the wallet can send and receive using all combinations of address types.
6
6
7
-
There are 4 nodes-under-test:
7
+
There are 5 nodes-under-test:
8
8
- node0 uses legacy addresses
9
9
- node1 uses p2sh/segwit addresses
10
10
- node2 uses p2sh/segwit addresses and bech32 addresses for change
11
11
- node3 uses bech32 addresses
12
+
- node4 uses a p2sh/segwit addresses for change
12
13
13
-
node4 exists to generate new blocks.
14
+
node5 exists to generate new blocks.
14
15
15
-
The script is a series of tests, iterating over the 4 nodes. In each iteration
16
-
of the test, one node sends:
16
+
## Multisig address test
17
+
18
+
Test that adding a multisig address with:
19
+
- an uncompressed pubkey always gives a legacy address
20
+
- only compressed pubkeys gives the an `-addresstype` address
21
+
22
+
## Sending to address types test
23
+
24
+
A series of tests, iterating over node0-node4. In each iteration of the test, one node sends:
17
25
- 10/101th of its balance to itself (using getrawchangeaddress for single key addresses)
18
26
- 20/101th to the next node
19
27
- 30/101th to the node after that
20
28
- 40/101th to the remaining node
21
29
- 1/101th remains as fee+change
22
30
23
31
Iterate over each node for single key addresses, and then over each node for
24
-
multisig addresses. In a second iteration, the same is done, but with explicit address_type
25
-
parameters passed to getnewaddress and getrawchangeaddress. Node0 and node3 send to p2sh,
26
-
node 1 sends to bech32, and node2 sends to legacy. As every node sends coins after receiving,
27
-
this also verifies that spending coins sent to all these address types works."""
32
+
multisig addresses.
33
+
34
+
Repeat test, but with explicit address_type parameters passed to getnewaddress
35
+
and getrawchangeaddress:
36
+
- node0 and node3 send to p2sh.
37
+
- node1 sends to bech32.
38
+
- node2 sends to legacy.
39
+
40
+
As every node sends coins after receiving, this also
41
+
verifies that spending coins sent to all these address types works.
42
+
43
+
## Change type test
44
+
45
+
Test that the nodes generate the correct change address type:
46
+
- node0 always uses a legacy change address.
47
+
- node1 uses a bech32 addresses for change if any destination address is bech32.
48
+
- node2 always uses a bech32 address for change
49
+
- node3 always uses a bech32 address for change
50
+
- node4 always uses p2sh/segwit output for change.
0 commit comments