Allow nonce/fee setting not to be present in chainlib cli
This commit is contained in:
parent
bff9305aac
commit
5b1755e50d
@ -56,14 +56,26 @@ class Rpc(BaseRpc):
|
|||||||
super(Rpc, self).connect_by_config(config)
|
super(Rpc, self).connect_by_config(config)
|
||||||
|
|
||||||
if self.can_sign():
|
if self.can_sign():
|
||||||
|
nonce = None
|
||||||
|
fee_price = None
|
||||||
|
fee_limit = None
|
||||||
|
try:
|
||||||
nonce = config.get('_NONCE')
|
nonce = config.get('_NONCE')
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
if nonce != None:
|
if nonce != None:
|
||||||
self.nonce_oracle = OverrideNonceOracle(self.get_sender_address(), nonce, id_generator=self.id_generator)
|
self.nonce_oracle = OverrideNonceOracle(self.get_sender_address(), nonce, id_generator=self.id_generator)
|
||||||
else:
|
else:
|
||||||
self.nonce_oracle = RPCNonceOracle(self.get_sender_address(), self.conn, id_generator=self.id_generator)
|
self.nonce_oracle = RPCNonceOracle(self.get_sender_address(), self.conn, id_generator=self.id_generator)
|
||||||
|
|
||||||
|
try:
|
||||||
fee_price = config.get('_FEE_PRICE')
|
fee_price = config.get('_FEE_PRICE')
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
fee_limit = config.get('_FEE_LIMIT')
|
fee_limit = config.get('_FEE_LIMIT')
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
if fee_price != None or fee_limit != None:
|
if fee_price != None or fee_limit != None:
|
||||||
self.fee_oracle = OverrideGasOracle(price=fee_price, limit=fee_limit, conn=self.conn, id_generator=self.id_generator)
|
self.fee_oracle = OverrideGasOracle(price=fee_price, limit=fee_limit, conn=self.conn, id_generator=self.id_generator)
|
||||||
else:
|
else:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = chainlib-eth
|
name = chainlib-eth
|
||||||
version = 0.0.9a3
|
version = 0.0.9a4
|
||||||
description = Ethereum implementation of the chainlib interface
|
description = Ethereum implementation of the chainlib interface
|
||||||
author = Louis Holbrook
|
author = Louis Holbrook
|
||||||
author_email = dev@holbrook.no
|
author_email = dev@holbrook.no
|
||||||
|
Loading…
Reference in New Issue
Block a user