Add conn to execution in chaind loop
This commit is contained in:
parent
e33fefe4b3
commit
c1f236769f
@ -28,8 +28,10 @@ class BaseTokenResolver:
|
||||
|
||||
|
||||
def get_values(self, gas_value, value, executable_address=None):
|
||||
nonce = self.nonce_oracle.next_nonce()
|
||||
|
||||
if executable_address == None:
|
||||
return (value, 0)
|
||||
return (value, 0, nonce)
|
||||
|
||||
try:
|
||||
value = int(value)
|
||||
@ -41,8 +43,6 @@ class BaseTokenResolver:
|
||||
except ValueError:
|
||||
gas_value = int(strip_0x(gas_value), 16)
|
||||
|
||||
nonce = self.nonce_oracle.next_nonce()
|
||||
|
||||
return (gas_value, value, nonce,)
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@ class GasTokenResolver(BaseTokenResolver):
|
||||
self.factory = Gas(self.chain_spec, signer=self.signer, gas_oracle=self.gas_oracle, nonce_oracle=self.nonce_oracle)
|
||||
|
||||
|
||||
def create(self, recipient, gas_value, data=None, token_value=0, executable_address=None, passphrase=None):
|
||||
def create(self, conn, recipient, gas_value, data=None, token_value=0, executable_address=None, passphrase=None):
|
||||
|
||||
(gas_value, token_value, nonce) = self.get_values(gas_value, token_value, executable_address=executable_address)
|
||||
|
||||
|
@ -84,7 +84,13 @@ class Processor:
|
||||
logg.debug('gasvalue {}'.format(gas_value))
|
||||
data = '0x'
|
||||
|
||||
tx = self.resolver.create(self.conn, r[0], gas_value, data=data, token_value=value, executable_address=r[2])
|
||||
executable_address = None
|
||||
try:
|
||||
executable_address = r[2]
|
||||
except IndexError:
|
||||
pass
|
||||
|
||||
tx = self.resolver.create(self.conn, r[0], gas_value, data=data, token_value=value, executable_address=executable_address)
|
||||
v = self.resolver.sign(tx)
|
||||
|
||||
self.cursor += 1
|
||||
|
Loading…
Reference in New Issue
Block a user