Add sender address to list call

This commit is contained in:
lash 2023-02-13 07:48:14 +00:00
parent 19532df107
commit 83d5224b6c
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
2 changed files with 7 additions and 6 deletions

View File

@ -35,7 +35,6 @@ from chainlib.eth.cli.log import process_log
from chainlib.eth.settings import process_settings
from chainlib.settings import ChainSettings
# local imports
from eth_contract_registry.registry import ContractRegistry
@ -76,17 +75,17 @@ def out_element(e, w=sys.stdout):
w.write(e[0] + '\t' + e[1] + '\n')
def element(ifc, conn, registry_address, identifier, w=sys.stdout):
o = ifc.address_of(registry_address, identifier, sender_address=ZERO_ADDRESS)
def element(ifc, conn, registry_address, identifier, w=sys.stdout, sender_address=ZERO_ADDRESS):
o = ifc.address_of(registry_address, identifier, sender_address=sender_address)
r = conn.do(o)
address = ifc.parse_address_of(r)
out_element((identifier, address), w)
def ls(ifc, conn, registry_address, w=sys.stdout):
def ls(ifc, conn, registry_address, w=sys.stdout, sender_address=ZERO_ADDRESS):
i = 0
while True:
o = ifc.identifier(registry_address, i)
o = ifc.identifier(registry_address, i, sender_address=sender_address)
try:
r = conn.do(o)
identifier = ifc.parse_identifier(r)
@ -114,6 +113,7 @@ def main():
settings.get('EXEC'),
config.get('_IDENTIFIER'),
w=sys.stdout,
sender_address=settings.get('SENDER_ADDRESS'),
)
else:
ls(
@ -121,6 +121,7 @@ def main():
settings.get('CONN'),
settings.get('EXEC'),
w=sys.stdout,
sender_address=settings.get('SENDER_ADDRESS'),
)

View File

@ -1,2 +1,2 @@
confini~=0.6.0
chainlib-eth~=0.4.7
chainlib-eth~=0.4.15