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)
|
||||
|
||||
if self.can_sign():
|
||||
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)
|
||||
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user