mirror of
git://holbrook.no/eth-accounts-index
synced 2024-11-22 00:56:46 +01:00
Rehabilitate commands
This commit is contained in:
parent
a5e6a90478
commit
7c3d939040
@ -11,7 +11,7 @@ from chainlib.eth.contract import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
# local imports
|
# local imports
|
||||||
from .index import AccountsIndex
|
from .interface import AccountsIndex
|
||||||
|
|
||||||
moddir = os.path.dirname(__file__)
|
moddir = os.path.dirname(__file__)
|
||||||
datadir = os.path.join(moddir, 'data')
|
datadir = os.path.join(moddir, 'data')
|
||||||
@ -42,7 +42,7 @@ class AccountRegistry(AccountsIndex):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def gas(code=None):
|
def gas(code=None):
|
||||||
return 700000
|
return 1200000
|
||||||
|
|
||||||
|
|
||||||
def constructor(self, sender_address):
|
def constructor(self, sender_address):
|
||||||
|
@ -28,7 +28,7 @@ from chainlib.eth.connection import EthHTTPConnection
|
|||||||
from chainlib.eth.tx import receipt
|
from chainlib.eth.tx import receipt
|
||||||
|
|
||||||
# local imports
|
# local imports
|
||||||
from eth_accounts_index import AccountsIndex
|
from eth_accounts_index.registry import AccountRegistry
|
||||||
|
|
||||||
logging.basicConfig(level=logging.WARNING)
|
logging.basicConfig(level=logging.WARNING)
|
||||||
logg = logging.getLogger()
|
logg = logging.getLogger()
|
||||||
@ -88,9 +88,9 @@ else:
|
|||||||
|
|
||||||
gas_oracle = None
|
gas_oracle = None
|
||||||
if args.gas_price !=None:
|
if args.gas_price !=None:
|
||||||
gas_oracle = OverrideGasOracle(price=args.gas_price, conn=rpc, code_callback=AccountsIndex.gas)
|
gas_oracle = OverrideGasOracle(price=args.gas_price, conn=rpc, code_callback=AccountRegistry.gas)
|
||||||
else:
|
else:
|
||||||
gas_oracle = RPCGasOracle(rpc, code_callback=AccountsIndex.gas)
|
gas_oracle = RPCGasOracle(rpc, code_callback=AccountRegistry.gas)
|
||||||
|
|
||||||
dummy = args.d
|
dummy = args.d
|
||||||
contract_address = args.a
|
contract_address = args.a
|
||||||
@ -100,7 +100,7 @@ account = args.address
|
|||||||
def main():
|
def main():
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
c = AccountsIndex(chain_spec, signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle)
|
c = AccountRegistry(chain_spec, signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle)
|
||||||
(tx_hash_hex, o) = c.add(contract_address, signer_address, account)
|
(tx_hash_hex, o) = c.add(contract_address, signer_address, account)
|
||||||
if dummy:
|
if dummy:
|
||||||
print(tx_hash_hex)
|
print(tx_hash_hex)
|
||||||
|
@ -55,8 +55,8 @@ if args.vv:
|
|||||||
elif args.v:
|
elif args.v:
|
||||||
logg.setLevel(logging.INFO)
|
logg.setLevel(logging.INFO)
|
||||||
|
|
||||||
block_last = args.w
|
block_all = args.ww
|
||||||
block_all = args.ww
|
block_last = args.w or block_all
|
||||||
|
|
||||||
passphrase_env = 'ETH_PASSPHRASE'
|
passphrase_env = 'ETH_PASSPHRASE'
|
||||||
if args.env_prefix != None:
|
if args.env_prefix != None:
|
||||||
|
@ -77,7 +77,7 @@ def element(ifc, address, fmt=default_format, w=sys.stdout):
|
|||||||
def ls(ifc, fmt=default_format, w=sys.stdout):
|
def ls(ifc, fmt=default_format, w=sys.stdout):
|
||||||
i = 1
|
i = 1
|
||||||
while True:
|
while True:
|
||||||
o = ifc.account(account_registry_address, i)
|
o = ifc.entry(account_registry_address, i)
|
||||||
try:
|
try:
|
||||||
r = rpc.do(o)
|
r = rpc.do(o)
|
||||||
account = ifc.parse_account(r)
|
account = ifc.parse_account(r)
|
||||||
|
Loading…
Reference in New Issue
Block a user