proto.eth: class rename: TokenResolve -> ResolvedToken

This commit is contained in:
The MMGen Project 2023-04-06 09:13:57 +00:00
commit e178bdc732
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
4 changed files with 9 additions and 6 deletions

View file

@ -163,7 +163,7 @@ class Token(TokenCommon):
self.base_unit = Decimal('10') ** -self.decimals
self.rpc = rpc
class TokenResolve(TokenCommon,metaclass=AsyncInit):
class ResolvedToken(TokenCommon,metaclass=AsyncInit):
async def __init__(self,cfg,proto,rpc,addr):
from ...util2 import get_keccak

View file

@ -23,7 +23,7 @@ proto.eth.tw.ctl: Ethereum tracking wallet control class
from ....util import msg,ymsg,die
from ....tw.ctl import TwCtl,write_mode
from ....addr import is_coin_addr,is_mmgen_id
from ..contract import Token,TokenResolve
from ..contract import Token,ResolvedToken
class EthereumTwCtl(TwCtl):
@ -232,7 +232,7 @@ class EthereumTokenTwCtl(EthereumTwCtl):
once, upon token import. Thereafter, token address, symbol and decimals are resolved
either from the tracking wallet (online operations) or transaction file (when signing).
"""
t = await TokenResolve(self.cfg,self.proto,self.rpc,tokenaddr)
t = await ResolvedToken(self.cfg,self.proto,self.rpc,tokenaddr)
self.data['tokens'][tokenaddr] = {
'params': {
'symbol': await t.get_symbol(),

View file

@ -61,6 +61,9 @@ class tool_api(
# Generate a random LTC testnet Bech32 keypair:
wif,addr = tool.randpair()
print('wif: ',wif)
print('addr:',addr)
"""
need_proto = True

View file

@ -972,10 +972,10 @@ class TestSuiteEthdev(TestSuiteBase,TestSuiteShared):
from mmgen.tool.wallet import tool_cmd
usr_mmaddrs = [f'{sid}:E:{i}' for i in (11,21)]
from mmgen.proto.eth.contract import TokenResolve
from mmgen.proto.eth.contract import ResolvedToken
async def do_transfer(rpc):
for i in range(2):
tk = await TokenResolve(
tk = await ResolvedToken(
cfg,
self.proto,
rpc,
@ -997,7 +997,7 @@ class TestSuiteEthdev(TestSuiteBase,TestSuiteShared):
async def show_bals(rpc):
for i in range(2):
tk = await TokenResolve(
tk = await ResolvedToken(
cfg,
self.proto,
rpc,