Allow nonce/fee setting not to be present in chainlib cli

This commit is contained in:
nolash 2021-08-25 12:05:48 +02:00
parent bff9305aac
commit 5b1755e50d
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
2 changed files with 17 additions and 5 deletions

View File

@ -56,14 +56,26 @@ class Rpc(BaseRpc):
super(Rpc, self).connect_by_config(config)
if self.can_sign():
nonce = config.get('_NONCE')
nonce = None
fee_price = None
fee_limit = None
try:
nonce = config.get('_NONCE')
except KeyError:
pass
if nonce != None:
self.nonce_oracle = OverrideNonceOracle(self.get_sender_address(), nonce, id_generator=self.id_generator)
else:
self.nonce_oracle = RPCNonceOracle(self.get_sender_address(), self.conn, id_generator=self.id_generator)
fee_price = config.get('_FEE_PRICE')
fee_limit = config.get('_FEE_LIMIT')
try:
fee_price = config.get('_FEE_PRICE')
except KeyError:
pass
try:
fee_limit = config.get('_FEE_LIMIT')
except KeyError:
pass
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)
else:

View File

@ -1,6 +1,6 @@
[metadata]
name = chainlib-eth
version = 0.0.9a3
version = 0.0.9a4
description = Ethereum implementation of the chainlib interface
author = Louis Holbrook
author_email = dev@holbrook.no