mirror of
git://holbrook.no/eth-contract-registry
synced 2024-11-16 06:26:47 +01:00
Add sender address to list call
This commit is contained in:
parent
19532df107
commit
83d5224b6c
@ -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'),
|
||||
)
|
||||
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
confini~=0.6.0
|
||||
chainlib-eth~=0.4.7
|
||||
chainlib-eth~=0.4.15
|
||||
|
Loading…
Reference in New Issue
Block a user