Commit graph

2,983 commits

Author SHA1 Message Date
d29602c460
test.py regtest: cleanups 2022-12-01 12:32:29 +00:00
045fdefd73
mmgen-txcreate: automatic change address selection by address type
This patch introduces an improvement to commit cbe749813 (automatic change
address selection)

Instead of supplying a Seed ID + address type, users may now specify the
address type alone.  If the tracking wallet contains more than one unused
address matching the user’s criteria, the user is prompted to choose a specific
change address.

As with plain auto change address selection, this feature is entirely opt-in.

Sample invocations:

    # old invocation:
    $ mmgen-txcreate -q 35N9FntsNwy98TmjFHyCpsBVDVUs5wDPfB,0.123 01ABCDEF:B

    # new invocation:
    $ mmgen-txcreate -q 35N9FntsNwy98TmjFHyCpsBVDVUs5wDPfB,0.123 B

    # or, alternatively:
    $ mmgen-txcreate -q 35N9FntsNwy98TmjFHyCpsBVDVUs5wDPfB,0.123 bech32

Testing/demo:

    # run the regtest test partially, leaving the coin daemon running:
    $ test/test.py -D regtest.auto_chg

    # run the auto chg addrtype test, displaying script output:
    $ test/test.py -SAe regtest:bob_auto_chg_addrtype1

    # view the addresses in Bob’s tracking wallet, verifying that the first
    # unused ones in each grouping were chosen as change outputs:
    $ PYTHONPATH=. MMGEN_TEST_SUITE=1 cmds/mmgen-tool --bob listaddresses interactive=1

    # When finished, gracefully shut down the daemon:
    $ test/stop-coin-daemons.py btc_rt
2022-11-26 18:55:57 +00:00
ba291d4799
tx.new.process_cmd_arg(): cleanups 2022-11-26 18:55:56 +00:00
4da94df0da
tx.info: display amounts with columnar alignment 2022-11-26 18:55:56 +00:00
addd94c702
tw.view: new line_processing class 2022-11-26 18:55:56 +00:00
eacf3ae802
minor fix and cleanup 2022-11-26 18:55:55 +00:00
0448f76b70
option rename: --tx-gas -> --gas
This change breaks compatibility.  Scripts may need to be adjusted.
2022-11-26 18:55:55 +00:00
41ba603b13
tx.new,tx.bump: variable rename: tx_fee -> fee 2022-11-26 18:55:55 +00:00
ad1286ab97
option rename: --tx-fee -> --fee
This change breaks compatibility.  Scripts may need to be adjusted.
2022-11-26 18:55:54 +00:00
3f79be6dac
option rename: --tx-fee-adj -> --fee-adjust
This change breaks compatibility.  Scripts may need to be adjusted.
2022-11-26 18:55:54 +00:00
c15c97a95e
option rename: --tx-confs -> --fee-estimate-confs
This change breaks compatibility.  Scripts may need to be adjusted.
2022-11-26 18:55:54 +00:00
1e983497c7
update documentation from wiki 2022-11-26 18:55:48 +00:00
cbe7498131
mmgen-txcreate: automatic change address selection
Instead of selecting a specific change address, i.e. '01ABCDEF:B:7', users can
now omit the address index, specifying '01ABCDEF:B' instead, and the script
will automatically choose the first unused address in the tracking wallet
matching the requested seed ID and address type.

This feature is entirely opt-in.  Existing behavior continues to be supported
without alteration.

Sample invocations:

    # old invocation:
    $ mmgen-txcreate -q 35N9FntsNwy98TmjFHyCpsBVDVUs5wDPfB,0.123 01ABCDEF:S:7

    # new invocation:
    $ mmgen-txcreate -q 35N9FntsNwy98TmjFHyCpsBVDVUs5wDPfB,0.123 01ABCDEF:S

Testing/demo:

    # run the regtest test partially, leaving the coin daemon running:
    $ test/test.py -Dn regtest.view

    # run the 'auto_chg' test group, displaying script output:
    $ test/test.py -DSAe regtest.auto_chg

    # view the addresses in Bob’s tracking wallet, verifying that the first
    # unused ones in each grouping were chosen as change outputs:
    $ PYTHONPATH=. MMGEN_TEST_SUITE=1 cmds/mmgen-tool --bob listaddresses interactive=1

    # When finished, gracefully shut down the daemon:
    $ test/stop-coin-daemons.py btc_rt
2022-11-16 18:22:29 +00:00
f3fb91e2a7
mmgen-{txcreate,txdo}: help screen fixes, add EXAMPLES section 2022-11-16 18:22:29 +00:00
015afee89f
opts.py: print help screen only after full initialization of opts 2022-11-16 18:22:28 +00:00
7311b2d1cf
AddrListID: support initialization from string + proto 2022-11-16 17:56:05 +00:00
f45c140350
tx.get_chg_output_idx() -> tx.chg_idx 2022-11-16 17:56:05 +00:00
20d35ea637
minor fixes 2022-11-16 17:56:05 +00:00
68caeb3130
mmgen-txcreate: warn user if change address is a used address 2022-11-16 17:56:04 +00:00
4b07f8fac8
tx.process_cmd_arg(), tx.add_comment(): cleanups 2022-11-16 17:56:04 +00:00
321c85bf8f
AddrListID: call cleanups; proto.btc.daemon: missing import fix 2022-11-16 17:56:04 +00:00
e7a60184ed
tw.view: skip rstrip() for screen formatting 2022-11-16 17:56:03 +00:00
0c4728b3fe
Python 3.7 compatibility fix 2022-11-14 09:54:08 +00:00
00a52b687d
TwCtl: variable, attribute and key renames
- tw -> twctl
- wallet -> twctl
2022-11-14 09:54:08 +00:00
a6307b59bb
tool.rpc: delete tracking wallet instance in twops() 2022-11-14 09:54:07 +00:00
20f4b12832
module docstring cleanups [134 files] 2022-11-14 09:54:07 +00:00
21b8084b37
class rename: TrackingWallet -> TwCtl 2022-11-14 09:54:02 +00:00
9c07442191
CoinAmt: improve columnar formatting 2022-11-13 15:36:35 +00:00
357f7806b8
mmgen-tool getbalance: reimplement 2022-11-13 15:36:35 +00:00
fbd71fba77
tracking wallet classes: whitespace, cleanup; test.py: minor fix 2022-11-13 15:36:34 +00:00
6da4063544
tracking wallet views: move module loading to tw.view 2022-11-12 13:35:50 +00:00
20b250ef98
proto.base_proto_subclass(): simplify call signature 2022-11-12 13:34:42 +00:00
e237cf0e39
tw.view.TwView: add __init__() method 2022-11-12 13:34:41 +00:00
d513035aad
tracking wallet classes: reorder methods, cleanups 2022-11-12 13:34:41 +00:00
69b15a4ff9
new class: tw.rpc.TwRPC 2022-11-12 13:34:41 +00:00
e7d75ff60d
minor cleanups 2022-11-12 13:34:40 +00:00
79bcc049a5
proto.{btc,eth}.tw: module moves, class renames
- proto.btc.tw.common -> proto.btc.tw.rpc
    - proto.eth.tw.common -> proto.eth.tw.rpc, proto.eth.tw.view

    - BitcoinTwCommon -> BitcoinTwRPC
    - EthereumTwCommon -> EthereumTwRPC, EthereumTwView
2022-11-12 13:34:40 +00:00
a7b11f1d3b
move TwMMGenID, TwLabel, get_tw_label() to tw.shared 2022-11-12 13:34:40 +00:00
5948bd4106
module rename: tw.common -> tw.view 2022-11-12 13:34:40 +00:00
14fb60bc67
tracking wallet: TwCommon -> TwView 2022-11-12 13:34:34 +00:00
f44078a187
tw.common: dynamic format strings; tw.unspent: reimplement display 2022-11-11 09:48:58 +00:00
03712efbfb
tracking wallet classes: various cleanups 2022-11-11 09:48:57 +00:00
1d392f1731
mmgen-tool listaddresses: fully reimplement
- reimplemented using the new tracking wallet display framework
- command is now interactive, with the same UI as 'twview' and 'txhist'
- the new 'Used' column shows whether an address has received funds
- the new tristate 'showused' filter allows display of only unused, used
  or all used addresses
- adding, removal and editing of labels is supported

Testing/demo:

    # Run the regtest test partially, leaving coin daemon running:
    $ test/test.py -De regtest.label

    # Try out the interactive sorting, filtering and label editing features:
    $ PYTHONPATH=. MMGEN_TEST_SUITE=1 cmds/mmgen-tool --bob listaddresses interactive=1

    # When finished, gracefully shut down the daemon:
    $ test/stop-coin-daemons.py btc_rt
2022-11-09 13:05:10 +00:00
8e04c21271
mmgen.tw.ctl: resolve MMGen address via get_addr_label_pairs() 2022-11-09 13:05:09 +00:00
b21864fd08
mmgen.tw.{ctl,common,txhistory,unspent}: cleanups 2022-11-09 13:05:09 +00:00
5d3ed7d976
mmgen.tw.common: new format(), header(), subheader() methods 2022-11-09 13:05:09 +00:00
560a082040
mmgen.tw.txhistory: reimplement display using compute_column_widths()
Testing/demo:

    $ test/test.py -e regtest.txhist
2022-11-09 13:05:08 +00:00
90d96168d6
mmgen.tw.common: new compute_column_widths() method
- automagically compute variable column widths for tabular display using the
  given input parameters

- 'nice' (low-priority) columns supported
2022-11-09 13:05:08 +00:00
2b026f1ae7
mmgen.tw.{common,addrs,txhistory,unspent}: cleanups 2022-11-09 13:05:08 +00:00
26dd466635
listaddresses: showbtcaddrs -> showcoinaddrs 2022-11-09 13:05:07 +00:00