diff --git a/mmgen/contrib/__init__.py b/mmgen/contrib/__init__.py new file mode 100755 index 00000000..e69de29b diff --git a/mmgen/base_proto/bitcoin/bech32.py b/mmgen/contrib/bech32.py similarity index 100% rename from mmgen/base_proto/bitcoin/bech32.py rename to mmgen/contrib/bech32.py diff --git a/mmgen/ed25519.py b/mmgen/contrib/ed25519.py similarity index 100% rename from mmgen/ed25519.py rename to mmgen/contrib/ed25519.py diff --git a/mmgen/ed25519ll_djbec.py b/mmgen/contrib/ed25519ll_djbec.py similarity index 100% rename from mmgen/ed25519ll_djbec.py rename to mmgen/contrib/ed25519ll_djbec.py diff --git a/mmgen/keccak.py b/mmgen/contrib/keccak.py similarity index 100% rename from mmgen/keccak.py rename to mmgen/contrib/keccak.py diff --git a/mmgen/license.py b/mmgen/contrib/license.py similarity index 99% rename from mmgen/license.py rename to mmgen/contrib/license.py index 1ba4f3e0..c2d9e6f6 100755 --- a/mmgen/license.py +++ b/mmgen/contrib/license.py @@ -20,7 +20,7 @@ license.py: Copyright notice and text of GPLv3 """ -from .globalvars import g +from ..globalvars import g warning = f""" {g.proj_name} Copyright (C) {g.Cdates} by {g.author} {g.email}. This diff --git a/mmgen/data/version b/mmgen/data/version index f3303951..0dcc20bf 100644 --- a/mmgen/data/version +++ b/mmgen/data/version @@ -1 +1 @@ -13.1.dev017 +13.1.dev018 diff --git a/mmgen/keygen.py b/mmgen/keygen.py index 0796acca..0275e2f8 100755 --- a/mmgen/keygen.py +++ b/mmgen/keygen.py @@ -137,7 +137,7 @@ class keygen_backend: def __init__(self): super().__init__() - from .ed25519 import edwards,encodepoint,B,scalarmult + from .contrib.ed25519 import edwards,encodepoint,B,scalarmult self.edwards = edwards self.encodepoint = encodepoint self.B = B @@ -173,7 +173,7 @@ class keygen_backend: def __init__(self): super().__init__() - from .ed25519ll_djbec import scalarmult + from .contrib.ed25519ll_djbec import scalarmult self.scalarmult = scalarmult class zcash_z: diff --git a/mmgen/proto/btc.py b/mmgen/proto/btc.py index 193651dc..3c85941c 100755 --- a/mmgen/proto/btc.py +++ b/mmgen/proto/btc.py @@ -86,7 +86,7 @@ class mainnet(CoinProtocol.Secp256k1): # chainparams.cpp def parse_addr(self,addr): if 'B' in self.mmtypes and addr[:len(self.bech32_hrp)] == self.bech32_hrp: - import mmgen.base_proto.bitcoin.bech32 as bech32 + import mmgen.contrib.bech32 as bech32 ret = bech32.decode(self.bech32_hrp,addr) if ret[0] != self.witness_vernum: @@ -117,7 +117,7 @@ class mainnet(CoinProtocol.Secp256k1): # chainparams.cpp def pubhash2bech32addr(self,pubhash): d = list(pubhash) - import mmgen.base_proto.bitcoin.bech32 as bech32 + import mmgen.contrib.bech32 as bech32 return bech32.bech32_encode(self.bech32_hrp,[self.witness_vernum]+bech32.convertbits(d,8,5)) class testnet(mainnet): diff --git a/mmgen/proto/xmr.py b/mmgen/proto/xmr.py index 115e2538..2112c83f 100755 --- a/mmgen/proto/xmr.py +++ b/mmgen/proto/xmr.py @@ -34,7 +34,7 @@ class mainnet(CoinProtocol.DummyWIF,CoinProtocol.Base): coin_amt = 'XMRAmt' def preprocess_key(self,sec,pubkey_type): # reduce key - from ..ed25519 import l + from ..contrib.ed25519 import l return int.to_bytes( int.from_bytes( sec[::-1], 'big' ) % l, self.privkey_len, diff --git a/mmgen/util.py b/mmgen/util.py index 6e061c01..c07dbcda 100755 --- a/mmgen/util.py +++ b/mmgen/util.py @@ -211,14 +211,14 @@ def get_keccak(): from .opts import opt # called in opts.init() via CoinProtocol, so must use getattr(): if getattr(opt,'use_internal_keccak_module',False): - from .keccak import keccak_256 + from .contrib.keccak import keccak_256 qmsg('Using internal keccak module by user request') return keccak_256 try: from sha3 import keccak_256 except: - from .keccak import keccak_256 + from .contrib.keccak import keccak_256 return keccak_256 @@ -619,7 +619,7 @@ def do_license_msg(immed=False): if opt.quiet or g.no_license or opt.yes or not g.stdin_tty: return - import mmgen.license as gpl + import mmgen.contrib.license as gpl msg(gpl.warning) from .term import get_char diff --git a/setup.cfg b/setup.cfg index 2213de70..02023bf0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -41,6 +41,7 @@ install_requires = packages = mmgen + mmgen.contrib mmgen.base_proto mmgen.base_proto.bitcoin mmgen.base_proto.bitcoin.tx diff --git a/test/hashfunc.py b/test/hashfunc.py index dbc1e8ae..049062f5 100755 --- a/test/hashfunc.py +++ b/test/hashfunc.py @@ -84,7 +84,7 @@ class TestHashFunc(object): class TestKeccak(TestHashFunc): desc = 'keccak_256' def __init__(self): - from mmgen.keccak import keccak_256 + from mmgen.contrib.keccak import keccak_256 import sha3 self.t_cls = keccak_256 self.hashlib = sha3 diff --git a/test/overlay/__init__.py b/test/overlay/__init__.py index 9978353f..485a26e1 100644 --- a/test/overlay/__init__.py +++ b/test/overlay/__init__.py @@ -38,6 +38,7 @@ def overlay_setup(repo_root): shutil.rmtree(overlay_dir,ignore_errors=True) for d in ( 'mmgen', + 'mmgen.contrib', 'mmgen.base_proto', 'mmgen.base_proto.bitcoin', 'mmgen.base_proto.bitcoin.tx',