mmgen-tool: add eth_checksummed_addr command
This commit is contained in:
parent
303027f02f
commit
aecc03e2a2
3 changed files with 12 additions and 0 deletions
|
|
@ -82,6 +82,7 @@ mods = {
|
|||
'b6dtohex',
|
||||
'bytespec',
|
||||
'bytestob58',
|
||||
'eth_checksummed_addr',
|
||||
'hash160',
|
||||
'hash256',
|
||||
'hexdump',
|
||||
|
|
|
|||
|
|
@ -173,3 +173,8 @@ class tool_cmd(tool_cmd_base):
|
|||
from ..baseconv import baseconv
|
||||
from ..util import remove_whitespace
|
||||
return baseconv('b6d').tohex( remove_whitespace(b6d_num), pad )
|
||||
|
||||
def eth_checksummed_addr(self,addr:'sstr'):
|
||||
"create a checksummed Ethereum address"
|
||||
from ..protocol import init_proto
|
||||
return init_proto('eth').checksummed_addr(addr)
|
||||
|
|
|
|||
|
|
@ -316,6 +316,12 @@ tests = {
|
|||
( ['nbytes=16'], {'boolfunc':is_b58_str}, ['-r0'] ),
|
||||
( ['nbytes=12','pad=0'], is_b58_str, ['-r0'] ),
|
||||
],
|
||||
'eth_checksummed_addr': [
|
||||
( ['00a329c0648769a73afac7f9381e08fb43dbea72'], '00a329c0648769A73afAc7F9381E08FB43dBEA72' ),
|
||||
( ['deadbeef'*5], 'DeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF' ),
|
||||
( ['ffffffff'*5], 'FFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF' ),
|
||||
( ['0'*39 + '1'], '0'*39 + '1' ),
|
||||
],
|
||||
},
|
||||
'Wallet': {
|
||||
'gen_key': [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue