Commit graph

68 commits

Author SHA1 Message Date
cb7f38370b
Update copyright dates 2021-02-19 20:09:06 +03:00
82001409f5
parity -> openethereum 2020-06-13 11:08:54 +00:00
b27da5d90e
CoinProtocol: remove 'daemon_name' attr 2020-06-13 10:21:01 +00:00
c3f185e8b0
eliminate use of global vars g.proto, g.coin, g.rpc and others
This patch eliminates nearly all the global variables that changed during the
execution of scripts.  With a few minor exceptions, global vars are now used
only during initialization or reserved for cfg file / cmdline options and other
unchanging values.

The result is a code base that's much more maintainable and extensible and less
error-prone.  The autosigning code, which supports signing of transactions for
multiple protocols and networks, has been greatly simplified.

Doing away with globals required many changes throughout the code base, and
other related (and not so related) changes and cleanups were made along the
way, resulting in an enormous patch.

Additional code changes include:

    - tx.py: complete reorganization of TX classes and use of nesting

    - protocol.py: separation of Regtest and Testnet into distinct subclasses
      with separate address and transaction files and file extensions

    - new module help.py for the help notes, loaded on demand

    - addr.py: rewrite of the address file label parsing code

    - tx.py,tw.py: use of generators to create formatted text

User-visible changes include:

    - importing of addresses for tokens not yet in the user's tracking wallet
      is now performed with the `--token-addr` option instead of `--token`

Testing:

    Testing this patch requires a full run of the test suite as described on the
    Test-Suite wiki page.
2020-05-28 09:53:34 +00:00
43432327c7
global change: init_coin() -> g.proto = init_proto() 2020-05-16 12:44:43 +00:00
31f7236731
protocol.py: new coin protocol instance attrs
- add 'testnet', 'regtest' and 'dcoin' attributes to coin protocol instance,
  remove is_testnet() method

- g.testnet -> g.proto.testnet, g.regtest -> g.proto.regtest

- g.coin and g.dcoin are now read-only properties shadowing g.proto.coin
  and g.proto.dcoin, respectively
2020-05-16 09:27:13 +00:00
8a4fbab48d
protocol.py: new init_proto() factory function 2020-05-14 16:40:45 +00:00
673b97b3b8
update copyright dates 2020-02-18 14:07:27 +00:00
3db1c423ef
gentest.py: forkcoin testing framework, BCH support 2019-11-06 17:35:14 +00:00
6eaf01f243
a few minor cleanups 2019-11-06 17:34:26 +00:00
7451f122ed
gentest.py: complete rewrite, move tool selection logic to altcoin.py 2019-11-04 16:48:25 +00:00
1295fdb6e0
altcoin trust level changes
- make trust level system consistent, include all coins
- rewrite init_genonly_altcoins():
  + with coin argument, create only requested protocol
  + with no arguments, create all protocols
2019-11-04 16:48:05 +00:00
5663ca0712
test-release.sh, gentest.py, tooltest.py: cleanups 2019-11-02 09:34:21 +00:00
b1454e2122
gentest.py: use full output of ethkey and zcash-mini tools 2019-11-01 19:43:43 +00:00
dc07cd3c39
gentest.py: test private key edge cases 2019-11-01 12:36:50 +00:00
9518f702a9
gentest.py: add moneropy as external checking library 2019-11-01 12:34:51 +00:00
d20d10b9a5
gentest.py: refactor compare_test() 2019-11-01 12:31:59 +00:00
622b63a19b
test suite: minor fixes and cleanups 2019-11-01 12:24:09 +00:00
6cf4fcc7e4
Use subprocess.run() throughout, related cleanups 2019-10-23 09:31:21 +00:00
f327ce2bf9
gentest.py: minor code cleanups 2019-10-20 17:20:35 +03:00
e5abf419c0
gentest.py: use ethkey for Ethereum tests 2019-10-20 17:09:09 +03:00
d49159a92b
various changes and fixes 2019-10-10 22:53:43 +03:00
e879b7e548
minor fixes 2019-05-20 18:43:02 +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
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
b5f1ebc640
py3port: make hexadecimal values be strings instead of bytes type
- binascii.hexlify(b'foo') -> b'foo'.hex()
- binascii.unhexlify('aabb') -> bytes.fromhex('aabb')
- replace HexBytes class with HexStr

This change has led to a ≈10% speedup in the full test-release.sh run
2019-03-17 13:33:55 +03:00
39e63bd75f Minor changes 2019-02-14 17:33:58 +03:00
514c1100ee Update copyright dates 2019-02-12 21:35:12 +03:00
d91328c2b1 py3port: a few encoding fixes 2019-02-10 22:19:55 +03:00
0eff2811e1
py3port: update tests 2018-10-31 21:20:59 +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
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
7ebe50dc0b
Use Exception attributes: e.message, e.code 2018-10-16 18:39:33 +03:00
b74b0fb57e
gentest.py: support pycoin v0.90a 2018-05-09 17:28:00 +03:00
33fc67e241
zcash: update address, viewkey prefixes 2018-05-09 17:23:33 +03:00
351f5f9118
Use new-style string formatting 2018-03-07 12:59:35 +03:00
6f572cddde
Bech32: additional tests 2018-03-06 10:28:41 +03:00
MMGen
83e9899b38
Version 0.9.6 2018-01-14 17:24:36 +03:00
MMGen
279e8872ef
Improve coin selection logic, allow coin disabling 2017-12-25 09:48:59 +03:00
MMGen
91ac2effb3
Key/address generation support for 144 altcoins
Support for these coins is EXPERIMENTAL, use at your own risk

    EXAMPLE: generate 10 Dogecoin key/address pairs with your default wallet:

        `mmgen-keygen --coin=doge 1-10`

    Keys for different coins are distinct, so users needn't worry about key reuse.

    Supported alts: 2give,42,611,ac,acoin,alf,anc,apex,arco,arg,aur,b2x,bcf,bch,blk,bmc,bqc,bsty,btcd,btq,bucks,cann,cash,cat,cbx,ccn,cdn,chc,clam,con,cpc,crps,csh,dash,dcr,dfc,dgb,dgc,doge,doged,dope,dvc,efl,emc,emd,enrg,esp,etc,eth,fai,fc2,fibre,fjc,flo,flt,fst,ftc,gcr,good,grc,gun,ham,html5,hyp,icash,infx,inpay,ipc,jbs,judge,lana,lat,ldoge,lmc,ltc,mars,mcar,mec,mint,mobi,mona,moon,mrs,mue,mxt,myr,myriad,mzc,neos,neva,nka,nlg,nmc,nto,nvc,ok,omc,omni,onion,onx,part,pink,pivx,pkb,pnd,pot,ppc,ptc,pxc,qrk,rain,rbt,rby,rdd,ric,sdc,sib,smly,song,spr,start,sys,taj,tit,tpc,trc,ttc,tx,uno,via,vpn,vtc,wash,wdc,wisc,wkc,wsx,xcn,xgb,xmg,xpm,xpoke,xred,xst,xvc,zec,zet,zlq,zoom,zrc

	Test the new functionality with `scripts/test-release.sh -Pn master alts`

B2X support disabled pending further testing
2017-12-24 15:26:23 +03:00
MMGen
4876ee47ed
View key support for Zcash z-addresses
- view keys are included in key-address lists
- tests updated to test the new functionality

- mmgen-tool: `compressed` and `segwit` args replaced by --type option
2017-12-18 20:19:01 +03:00
MMGen
1cc64e1eb9
Zcash z-address generation with custom sha256 implementation
- Tests have been updated, test with `scripts/test-release.sh -Pn master alts`
2017-12-16 12:48:47 +03:00
MMGen
bafea57134
Key/address generation for Ethereum, Eth Classic, DASH, and Zcash
- supported commands:
  - mmgen-addrgen
  - mmgen-keygen (decrypt encrypted key-addr files with `mmgen-tool decrypt`)
  - mmgen-tool addrfile_chksum, keyaddrfile_chksum

- ETH and ETC keys are distinct, so users needn't worry about key reuse
- Only Zcash-t addresses supported for now (but z-addresses coming soon)

- Test the new functionality with `scripts/test-release.sh -Pn master alts`
2017-12-16 09:31:00 +03:00
philemon
35d1091159
Basic altcoin framework, full Litecoin support
- LTC: tested on mainnet, full test suite support
- simultaneous autosigning for all supported coins (BTC,BCH,LTC)
2017-10-28 00:11:00 +03:00
philemon
b23b497d77
obj.py rewrite+test suite, Bob and Alice regtest mode, compressed addresses
- basic data types in obj.py rewritten
- new test suite 'test/objtest.py' for testing basic data types
- new compressed address type with the 'C' identifier

- Bob and Alice regtest mode for testing MMGen in a mock two-user environment
  * All MMGen commands are available in this mode.
  * Set up with 'mmgen-regtest setup'. Bob and Alice's wallets are funded with
    500 BTC each.  Use the --mixed switch to import mixed address types in
    Bob and Alice's tracking wallets.
  * Transact as Bob by adding --bob switch to MMGen commands
  * Transact as Alice by adding --alice switch to MMGen commands
  * After sending a transaction, mine a block to confirm it with
    'mmgen-regtest generate'
    The bitcoin daemon is stopped and restarted automatically when switching
    between users.
2017-08-14 13:04:25 +03:00
philemon
52fdf29b67
new classes: KeyGenerator,AddrGenerator,PrivKey; read-only attrs rewrite
- OO rewrite of key/addr generation interface (KeyGenerator,AddrGenerator)
- New data objects: PrivKey,PubKey,WifKey
- rewrite of read-only attr implementation for addr/tx/tw list entries
  (MMGenImmutableAttr,MMGenListItemAttr descriptors)
- txsign: build key list of addrlist objects rather than addr,key tuples
2017-08-07 22:02:24 +03:00