proto.eth.misc -> proto.eth.util

This commit is contained in:
The MMGen Project 2025-06-29 14:04:46 +00:00
commit c62d3f1a38
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
4 changed files with 7 additions and 7 deletions

View file

@ -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(

View file

@ -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

View file

@ -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()

View file

@ -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():