Commit graph

174 commits

Author SHA1 Message Date
729a547c7d
tool.py, main_tool.py: major rewrite, cleanup
- group tool commands into classes
- add docstrings to command classes and methods
- annotate command method args
- generate call signatures + help and usage screens on the fly

- API changes:
  - listaddresses,twview: new 'age_fmt' option replaces 'show_days' and 'show_age'
  - addrfile_chksum and friends: 'mmtype' option removed

- tooltest.py, tooltest2.py and test.py have been updated accordingly
2019-02-22 23:23:06 +03:00
26ba8baa97
test-release.sh, tooltest.py, tooltest2.py: minor changes, exception handling 2019-02-19 17:53:21 +03:00
558fa58f91
New test 'tooltest2.py' for testing 'mmgen-tool'
- 2 modes of operation:
	- test tool commands by spawning the executable 'mmgen-tool'
	- test tool commands directly, by importing 'mmgen.tool'
- all test vectors are contained in the script
- no dependency chains or IPC via the filesystem
2019-02-19 14:23:47 +03:00
190d6e70b5
tooltest.py: refactor; downcase method names 2019-02-19 12:04:36 +03:00
583430b262
test.py: new '--list-cmd-groups' option 2019-02-19 12:02:49 +03:00
7b1b235a80
tool.py: new MMGenToolCmd class 2019-02-17 23:00:08 +03:00
39e63bd75f Minor changes 2019-02-14 17:33:58 +03:00
6289180c1f py3port: test.py: add 'ref_hincog_blkdev_conv_out' (test read/write from block device) 2019-02-13 17:54:44 +03:00
514c1100ee Update copyright dates 2019-02-12 21:35:12 +03:00
766281cb0e py3port: test.py: improved version checking for solc 2019-02-12 21:08:18 +03:00
8c1df23332 py3port: 'test.py autosign_live' - test device insertion/removal + LED 2019-02-12 13:41:27 +03:00
80564f6efd py3port: allow solc v0.5.1 or v0.5.3, update ethdev test vectors accordingly 2019-02-10 22:25:03 +03:00
d91328c2b1 py3port: a few encoding fixes 2019-02-10 22:19:55 +03:00
3f83f4bd82 py3port: test.py: ethdev: permit port-forwarded RPC 2019-02-08 15:12:54 +03:00
d67c92e831 py3port: test.py: add 'autosign_minimal' test 2019-02-08 15:10:35 +03:00
88039bb3c1 py3port: minor fixes 2019-02-08 15:06:03 +03:00
7c0caa3815 py3port: test.py: rewrite autosign() 2019-02-06 19:23:35 +03:00
fb07b089be py3port: ERC20: support/require Solidity compiler version 0.5.3 2019-02-06 14:05:37 +03:00
c2675c15ed
py3port: headers 2018-11-17 23:34:04 +03:00
44eb299442
py3port: revert some changes made by 2to3 2018-11-01 20:34:29 +03:00
0eff2811e1
py3port: update tests 2018-10-31 21:20:59 +03:00
53189f4469
py3port: Zcash and Monero-related changes 2018-10-31 21:12:07 +03:00
81548b9a35
py3port: exec, subprocess: 'python' -> 'python3' 2018-10-31 19:37:34 +03:00
af2bec1220
py3port: new HexBytes class 2018-10-31 19:32:03 +03:00
a97995c6cb
py3port: use os.write() instead of sys.std{out,err}.write() for terminal output 2018-10-31 19:09:01 +03:00
25c31e8c32
py3port: Exception as e: e.message -> e.args[0] 2018-10-31 18:44:10 +03:00
f6d5c5b465
py3port: replace s.encode('hex'), s.decode('hex') with hexlify(), unhexlify() 2018-10-31 18:30:11 +03:00
04329b6757
py3port: use encode() and decode() where applicable 2018-10-31 17:16:00 +03:00
46f44b645b
py3port: use floor division where applicable 2018-10-31 16:38:21 +03:00
2c253c0750
py3port: use bytes literals where applicable ('foo' -> b'foo') 2018-10-31 16:28:54 +03:00
949e42ebf4
py3port: 2to3 on all files
The result of running 2to3-2.7 on all Python files in the repository.
2018-10-30 19:31:14 +03:00
f0fea335eb
py3port: update hashbangs
This is the first commit of the MMGen Python 3 port.  Branch 'py3port', against
master branch commit ab06ca4

Commits are groupings of similar or related changes: automatic changes first,
followed by repetitive and global changes, followed by specific ones

All commits until the final one will leave the branch in a broken state
2018-10-30 19:23:12 +03:00
ab06ca4ea8
Rename traceback file; bump version to 0.9.999 2018-10-30 18:50:18 +03:00
abbdda0dcf
Add return codes to exception classes, handle on exit 2018-10-24 17:09:51 +03:00
92e6d77779
test.py ethdev: support UTF8 filenames, improve balance checks 2018-10-20 22:13:51 +03:00
0408c4e304
Bitcoin Core v0.17.0 compatibility patch
- support new label API
- support new signrawtransactionwithkey RPC method
2018-10-19 03:30:04 +03:00
7ebe50dc0b
Use Exception attributes: e.message, e.code 2018-10-16 18:39:33 +03:00
084b493b7f
tw view: cleanups, interactive address removal for ETH 2018-10-15 18:58:57 +03:00
80e2530c98
Version 0.9.9rc1 2018-10-13 19:52:25 +03:00
d9b344d1f5
eth: listaddresses, twview display fixes; add tests
- remove confirmations and days columns in address lists for eth
2018-10-13 18:00:03 +03:00
d4eb8f6ac0
Full Ethereum Classic (ETC) + ERC20 token support
As with ETH transacting support, this feature is in beta phase

All key functionality works, for both ETC and ETC tokens:
- Tracking wallet: getbalance, twview, listaddresses
- TX create, send, sign
- TX bumping
- ERC20 token creation, deployment

For usage details, see https://github.com/mmgen/mmgen/wiki/Altcoin-and-Forkcoin-Support

Differences from ETH:
- Start Parity with --jsonrpc-port=8555 (or --ports-shift=10) and --chain=classic
- Launch MMGen commands with --coin=etc
2018-10-02 21:09:48 +03:00
254412b84d
test.py: eth_args -> eth_args() (minor change) 2018-10-02 10:26:47 +03:00
4df12def5f
autosign: support testnet, ERC20 tokens 2018-07-29 17:24:29 +03:00
8aae3a8d31
Minor changes 2018-07-29 17:21:08 +03:00
d1970d1473
tx.process_cmd_args(); ETH: no-change tx support, tx.get_status(), other fixes 2018-07-28 16:52:43 +03:00
3fe7aad5aa
test.py: update regtest balances 2018-07-28 12:00:20 +03:00
881d55993f
ERC20 token support (create/deploy, TX create/sign/send)
This feature is EXPERIMENTAL.  Until v0.9.9 is released, mainnet use is
strictly at your own risk!

To test on dev chain, run 'test/test.py -e ethdev'

To test on Kovan, add '--testnet=1' option to all commands below

Transaction example:

    Generate some ETH addresses with your default wallet:
    $ mmgen-addrgen --coin=eth 1-5

    Create an EOS token tracking wallet and import the addresses into it:
    $ mmgen-addrimport --coin=eth --token=86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0 ABCDABCD-ETH[1-5].addrs

    Send 10+ EOS from an exchange or another wallet to address ABCDABCD:E:1

    Create a TX sending 10 EOS to address aabbccdd..., with change to ABCDABCD:E:2:
    $ mmgen-txcreate --coin=eth --token=eos aabbccddaabbccddaabbccddaabbccddaabbccdd,10 ABCDABCD:E:2

    On your offline machine, sign the TX:
    $ mmgen-txsign --coin=eth --token=eos ABC123-EOS[10,50000].rawtx

    On your online machine, send the TX:
    $ mmgen-txsend --coin=eth --token=eos ABC123-EOS[10,50000].sigtx

    View your EOS tracking wallet:
    $ mmgen-tool --coin=eth --token=eos twview

Token creation/deployment example:

    Install the Solidity compiler ('solc') on your system.

    Create a token 'MFT' with default parameters, owned by ddeeff... (ABCDABCD:E:1):
    $ scripts/create-token.py --symbol=MFT --name='My First Token' ddeeffddeeffddeeffddeeffddeeffddeeffddee

    Deploy the token on the ETH blockchain:
    $ mmgen-txdo --coin=eth --tx-gas=200000 --contract-data=SafeMath.bin
    $ mmgen-txdo --coin=eth --tx-gas=250000 --contract-data=Owned.bin
    $ mmgen-txdo --coin=eth --tx-gas=1100000 --contract-data=Token.bin
    ...
    Token address: abcd1234abcd1234abcd1234abcd1234abcd1234

    Create an MFT token tracking wallet and import your ETH addresses into it:
    $ mmgen-addrimport --coin=eth --token=abcd1234abcd1234abcd1234abcd1234abcd1234 ABCDABCD-ETH[1-5].addrs

    View your MFT tracking wallet:
    $ mmgen-tool --coin=eth --token=mft twview
2018-07-25 15:57:04 +03:00
e978b759d8
test/test.py,scripts/test-release.py: minor changes 2018-07-25 15:34:50 +03:00
e0dad2e108
test/test.py: update eth ref tx files 2018-07-25 14:08:58 +03:00
fad573eccd
tx.py,tw.py: cleanups, support tx inputs from cmdline 2018-07-24 00:17:05 +03:00