Commit graph

212 commits

Author SHA1 Message Date
43432327c7
global change: init_coin() -> g.proto = init_proto() 2020-05-16 12:44:43 +00:00
da5742f667
various cleanups throughout 2020-04-12 15:02:52 +00:00
673b97b3b8
update copyright dates 2020-02-18 14:07:27 +00:00
d57631695a
test suite: move path fixup code to test/tests_header.py 2019-10-23 10:01:11 +00:00
6cf4fcc7e4
Use subprocess.run() throughout, related cleanups 2019-10-23 09:31:21 +00:00
23ae73d908
minor fixes and cleanups 2019-07-03 20:30:53 +03:00
4a2cc07ef1
relocate test-release.sh script to test directory 2019-04-19 17:37:32 +03:00
823e325c6c
[msys2]: enable color output, handle exceptions in main.py 2019-03-27 19:52:29 +03:00
4240393804
minor fixes 2019-03-26 16:02:10 +03:00
017ecef3bc
[opts]: separate code from text in opts_data
- When parsing opts, opts.init() now looks only at string values from
  opts_data.  Global variables are evaluated only when printing help text,
  after the variables are initialized
2019-03-26 15:59:37 +03:00
dcab10949e
Support MSWin via MSYS2
This is a work in progress.  Currently, basic operations for BTC and ETH are
supported.

The successor to the MinGW64 project, MSYS2 features package management via
`pacman` and support for Python 3:

    https://sourceforge.net/projects/msys2
    https://www.msys2.org
2019-03-25 13:07:04 +03:00
66d0f76635
Eliminate dependencies on all ethereum packages except py_ecc
The rationale for this patch is similar to that of commit a7126ed:

- Many packages were imported for the sake of just a few trivial conversion
  functions.  These functions have been copied into the local pyethereum.utils.

- rlp has been locally copied and its import statements modified to import
  the locally-copied functions.  Unneeded classes and functions have been
  removed.

- As a result, dependencies on the following external packages have been
  eliminated:

  + rlp
  + eth-hash
  + eth-utils
  + eth-typing
  + toolz
  + cytoolz
  + setuptools
2019-03-25 12:38:49 +03:00
a7126ede03
Remove dependencies on pysha3 and ethereum modules
- pysha3: Monero and Ethereum use the old pre-SHA3 version of the keccak
  hash function, which is not supported by hashlib.sha3.

  The pysha3 package supports the function but is not portable.

  Therefore, use the pure-Python implementation mmgen.keccak as a fallback,
  making the pysha3 package optional.

  Use of mmgen.keccak may be forced with --use-internal-keccak-module

  mmgen.keccak was ported from the Python 2 implementation at
  https://github.com/ctz/keccak

- ethereum (pyethereum): Installation of this package presents numerous
  problems due to poor maintenance and many superfluous dependencies.

  Therefore, use stripped-down and modified local versions of
  ethereum.transactions and ethereum.utils as fallbacks, making the ethereum
  package optional.

  The local pyethereum.utils uses mmgen.keccak as a fallback for pysha3's
  keccak implementation.
2019-03-23 17:21:34 +03:00
281e1f3ffb
minor fixes 2019-03-22 14:32:22 +03:00
f7b59022a4
silent -> quiet file opens + minor fixes 2019-03-20 20:10:46 +03:00
785582e30d
MMGenTxInput, MMGenTxOutput: make 'amt' attribute a property
- type checking 'amt' at runtime eliminates the need to reload tx module
  when g.proto changes
2019-03-19 15:04:18 +03:00
a8e140f6ea
Add unit_tests.py to test-release.sh; minor fixes 2019-03-19 10:44:37 +03:00
634fb2e444
py3port: use dictionary comprehensions where applicable 2019-03-16 20:45:44 +03:00
ae77cb4a51
remove scripts/tx-v1-to-v3.py 2019-03-16 20:41:02 +03:00
2b6dc95970
rewrite SHA2 implementation, support SHA512; update tests accordingly
- Note: the sha2 module is used by MMGen solely for generating Zcash
  addresses and viewkeys
2019-03-15 12:09:38 +03:00
0879e53e74
tooltest2.py - add BTC test vectors
tooltest.py  - bugfixes, remove some commands covered in tooltest2.py
mmgen-tool   - bugfixes, cleanups, rename some commands, change some command
               options
			 - all commands taking binary input can now receive it from file
			   or stdin

+ numerous minor fixes throughout
2019-03-06 23:58:59 +03:00
91410dd96c
test.py: refactor, modularize, cleanup code, make fully OO
- test groups are now separate classes in separate modules
- test data and code is loaded on an as-needed basis
- new TestSuiteRunner and CmdGroupMgr classes
- simplified invocation: if arguments are omitted, all default tests relevant
  for given network and option are run.  The following set of invocations
  provides nearly complete coverage of MMGen's core functionality:

    test/test.py
    test/test.py --segwit-random
    test/test.py --bech32

    test/test.py --coin=ltc
    test/test.py --coin=ltc --segwit-random
    test/test.py --coin=ltc --bech32

    test/test.py --coin=bch
    test/test.py --coin=eth
    test/test.py --coin=etc
2019-03-02 21:27:53 +03:00
b61d516acd
test-release.sh: change option names, alter behavior of '-f' (speedup) option 2019-02-28 13:57:35 +03:00
6a90340671
minor changes 2019-02-28 13:51:27 +03:00
7ac23b6bf3
create new uninstall script 2019-02-28 13:38:52 +03:00
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
514c1100ee Update copyright dates 2019-02-12 21:35:12 +03:00
8c1df23332 py3port: 'test.py autosign_live' - test device insertion/removal + LED 2019-02-12 13:41:27 +03:00
bbdefce0a2 py3port: minor fixes 2019-02-12 13:38:22 +03:00
44c529ae8d py3port: test-release.sh: add autosign_minimal test, --buf-keypress option 2019-02-10 22:26:22 +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
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
0482594e7a
py3port: traceback_run fixes 2018-11-15 15:57:31 +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
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
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
3b7fbc1462
test-release.sh: minor changes 2018-10-24 17:05:04 +03:00
7ebe50dc0b
Use Exception attributes: e.message, e.code 2018-10-16 18:39:33 +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
4df12def5f
autosign: support testnet, ERC20 tokens 2018-07-29 17:24:29 +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