mirror of
git://holbrook.no/eth-accounts-index
synced 2024-11-21 16:46:46 +01:00
Add id generator to interface methods
This commit is contained in:
parent
713d8338fa
commit
c630627e98
@ -15,9 +15,7 @@ from chainlib.eth.contract import (
|
||||
abi_decode_single,
|
||||
)
|
||||
from chainlib.eth.constant import ZERO_ADDRESS
|
||||
from chainlib.jsonrpc import (
|
||||
jsonrpc_template,
|
||||
)
|
||||
from chainlib.jsonrpc import JSONRPCRequest
|
||||
from chainlib.eth.error import RequestMismatchException
|
||||
from hexathon import (
|
||||
add_0x,
|
||||
@ -45,8 +43,9 @@ class AccountsIndex(TxFactory):
|
||||
return self.__single_address_method('add', contract_address, sender_address, address, tx_format)
|
||||
|
||||
|
||||
def have(self, contract_address, address, sender_address=ZERO_ADDRESS):
|
||||
o = jsonrpc_template()
|
||||
def have(self, contract_address, address, sender_address=ZERO_ADDRESS, id_generator=None):
|
||||
j = JSONRPCRequest(id_generator)
|
||||
o = j.template()
|
||||
o['method'] = 'eth_call'
|
||||
enc = ABIContractEncoder()
|
||||
enc.method('have')
|
||||
@ -59,8 +58,9 @@ class AccountsIndex(TxFactory):
|
||||
return o
|
||||
|
||||
|
||||
def entry_count(self, contract_address, sender_address=ZERO_ADDRESS):
|
||||
o = jsonrpc_template()
|
||||
def entry_count(self, contract_address, sender_address=ZERO_ADDRESS, id_generator=None):
|
||||
j = JSONRPCRequest(id_generator)
|
||||
o = j.template()
|
||||
o['method'] = 'eth_call'
|
||||
enc = ABIContractEncoder()
|
||||
enc.method('entryCount')
|
||||
@ -71,12 +71,13 @@ class AccountsIndex(TxFactory):
|
||||
return o
|
||||
|
||||
|
||||
def count(self, contract_address, sender_address=ZERO_ADDRESS):
|
||||
return self.entry_count(contract_address, sender_address=sender_address)
|
||||
def count(self, contract_address, sender_address=ZERO_ADDRESS, id_generator=None):
|
||||
return self.entry_count(contract_address, sender_address=sender_address, id_generator=id_generator)
|
||||
|
||||
|
||||
def entry(self, contract_address, idx, sender_address=ZERO_ADDRESS):
|
||||
o = jsonrpc_template()
|
||||
def entry(self, contract_address, idx, sender_address=ZERO_ADDRESS, id_generator=None):
|
||||
j = JSONRPCRequest(id_generator)
|
||||
o = j.template()
|
||||
o['method'] = 'eth_call'
|
||||
enc = ABIContractEncoder()
|
||||
enc.method('entry')
|
||||
|
@ -1,6 +1,6 @@
|
||||
[metadata]
|
||||
name = eth-accounts-index
|
||||
version = 0.1.2a2
|
||||
version = 0.1.2a3
|
||||
description = Accounts index evm contract tooling with permissioned writes
|
||||
author = Louis Holbrook
|
||||
author_email = dev@holbrook.no
|
||||
|
Loading…
Reference in New Issue
Block a user