diff --git a/mmgen/key.py b/mmgen/key.py index b951fab3..544539bc 100755 --- a/mmgen/key.py +++ b/mmgen/key.py @@ -103,7 +103,7 @@ class PrivKey(bytes,Hilite,InitErrors,MMGenObject): assert type(compressed) == bool,( f"'compressed' must be of type bool, not {type(compressed).__name__}" ) me = bytes.__new__( cls, proto.preprocess_key(s,pubkey_type) ) - me.wif = WifKey( proto, proto.bytes2wif(me,pubkey_type,compressed) ) + me.wif = WifKey( proto, proto.encode_wif(me,pubkey_type,compressed) ) me.compressed = compressed me.pubkey_type = pubkey_type me.orig_bytes = s # save the non-preprocessed key diff --git a/mmgen/proto/btc.py b/mmgen/proto/btc.py index 0ea88e26..80d6d2f0 100755 --- a/mmgen/proto/btc.py +++ b/mmgen/proto/btc.py @@ -50,7 +50,7 @@ class mainnet(CoinProtocol.Secp256k1): # chainparams.cpp ignore_daemon_version = False max_int = 0xffffffff - def bytes2wif(self,privbytes,pubkey_type,compressed): # input is preprocessed hex + def encode_wif(self,privbytes,pubkey_type,compressed): # input is preprocessed hex assert len(privbytes) == self.privkey_len, f'{len(privbytes)} bytes: incorrect private key length!' assert pubkey_type in self.wif_ver_num, f'{pubkey_type!r}: invalid pubkey_type' return b58chk_encode( diff --git a/mmgen/protocol.py b/mmgen/protocol.py index e4e7baa4..da0ab19a 100755 --- a/mmgen/protocol.py +++ b/mmgen/protocol.py @@ -189,7 +189,7 @@ class CoinProtocol(MMGenObject): """ Ethereum and Monero protocols inherit from this class """ - def bytes2wif(self,privbytes,pubkey_type,compressed): + def encode_wif(self,privbytes,pubkey_type,compressed): assert pubkey_type == self.pubkey_type, f'{pubkey_type}: invalid pubkey_type for {self.name} protocol!' assert compressed == False, f'{self.name} protocol does not support compressed pubkeys!' return privbytes.hex()