diff --git a/mmgen/proto/eth/msg.py b/mmgen/proto/eth/msg.py index 37897dde..2891d0a7 100755 --- a/mmgen/proto/eth/msg.py +++ b/mmgen/proto/eth/msg.py @@ -23,14 +23,14 @@ class coin_msg(coin_msg): class unsigned(coin_msg.unsigned): async def do_sign(self, wif, message, msghash_type): - from .misc import ec_sign_message_with_privkey + from .util import ec_sign_message_with_privkey return ec_sign_message_with_privkey(self.cfg, message, bytes.fromhex(wif), msghash_type) class signed_online(coin_msg.signed_online): async def do_verify(self, addr, sig, message, msghash_type): from ...tool.coin import tool_cmd - from .misc import ec_recover_pubkey + from .util import ec_recover_pubkey return tool_cmd( self.cfg, proto = self.proto).pubhex2addr( diff --git a/mmgen/proto/eth/misc.py b/mmgen/proto/eth/util.py similarity index 97% rename from mmgen/proto/eth/misc.py rename to mmgen/proto/eth/util.py index 8d47c986..e569d447 100755 --- a/mmgen/proto/eth/misc.py +++ b/mmgen/proto/eth/util.py @@ -9,7 +9,7 @@ # https://gitlab.com/mmgen/mmgen-wallet """ -proto.eth.misc: miscellaneous utilities for Ethereum base protocol +proto.eth.util: various utilities for Ethereum base protocol """ from ...util2 import get_keccak diff --git a/mmgen/tool/fileutil.py b/mmgen/tool/fileutil.py index 5502153c..f1b5521b 100755 --- a/mmgen/tool/fileutil.py +++ b/mmgen/tool/fileutil.py @@ -164,5 +164,5 @@ class tool_cmd(tool_cmd_base): "decrypt the private key in a Geth keystore wallet, returning the decrypted key in hex format" from ..ui import line_input passwd = line_input(self.cfg, 'Enter passphrase: ', echo=self.cfg.echo_passphrase).strip().encode() - from ..proto.eth.misc import decrypt_geth_keystore + from ..proto.eth.util import decrypt_geth_keystore return decrypt_geth_keystore(self.cfg, wallet_file, passwd, check_addr=check_addr).hex() diff --git a/test/cmdtest_d/ethdev.py b/test/cmdtest_d/ethdev.py index b77a6823..85f16424 100755 --- a/test/cmdtest_d/ethdev.py +++ b/test/cmdtest_d/ethdev.py @@ -28,7 +28,7 @@ from pathlib import Path from mmgen.color import red, yellow, blue, cyan, orange, set_vt100 from mmgen.util import msg, msg_r, rmsg, die -from mmgen.proto.eth.misc import compute_contract_addr +from mmgen.proto.eth.util import compute_contract_addr from ..include.common import ( cfg, @@ -799,7 +799,7 @@ class CmdTestEthdev(CmdTestEthdevMethods, CmdTestBase, CmdTestShared): wallet_fn = os.path.join( self.keystore_dir, os.listdir(self.keystore_dir)[0]) - from mmgen.proto.eth.misc import decrypt_geth_keystore + from mmgen.proto.eth.util import decrypt_geth_keystore key = decrypt_geth_keystore( cfg = self.cfg, wallet_fn = wallet_fn, @@ -1160,7 +1160,7 @@ class CmdTestEthdev(CmdTestEthdevMethods, CmdTestBase, CmdTestShared): def create_signature_mmgen(): key = self.keystore_data['key'] imsg(f'Key: {key}') - from mmgen.proto.eth.misc import ec_sign_message_with_privkey + from mmgen.proto.eth.util import ec_sign_message_with_privkey return ec_sign_message_with_privkey(self.cfg, self.message, bytes.fromhex(key), 'eth_sign') async def create_signature_rpc():