bugfixes
This commit is contained in:
@@ -90,14 +90,16 @@ class SwapOrderStatus (SwapStatus):
|
|||||||
state = SwapOrderState(obj[1])
|
state = SwapOrderState(obj[1])
|
||||||
start = obj[2]
|
start = obj[2]
|
||||||
ocoGroup = None if obj[3] == NO_OCO else obj[3]
|
ocoGroup = None if obj[3] == NO_OCO else obj[3]
|
||||||
filledIn = obj[4]
|
filledIn = int(obj[4])
|
||||||
filledOut = obj[5]
|
filledOut = int(obj[5])
|
||||||
trancheFilledIn = obj[6]
|
trancheFilledIn = [int(f) for f in obj[6]]
|
||||||
trancheFilledOut = obj[7]
|
trancheFilledOut = [int(f) for f in obj[7]]
|
||||||
return SwapOrderStatus(order, state, start, ocoGroup, filledIn, filledOut, trancheFilledIn, trancheFilledOut)
|
return SwapOrderStatus(order, state, start, ocoGroup, filledIn, filledOut, trancheFilledIn, trancheFilledOut)
|
||||||
|
|
||||||
def dump(self):
|
def dump(self):
|
||||||
return self.order.dump(), self.state.value, self.start, self.ocoGroup, self.filledIn, self.filledOut, self.trancheFilledIn, self.trancheFilledOut
|
return (self.order.dump(), self.state.value, self.start, self.ocoGroup,
|
||||||
|
str(self.filledIn), str(self.filledOut),
|
||||||
|
[str(f) for f in self.trancheFilledIn], [str(f) for f in self.trancheFilledOut])
|
||||||
|
|
||||||
def copy(self):
|
def copy(self):
|
||||||
return copy.deepcopy(self)
|
return copy.deepcopy(self)
|
||||||
|
|||||||
@@ -74,7 +74,9 @@ async def create_transaction(job: TransactionJob):
|
|||||||
db.session.add(dbtx)
|
db.session.add(dbtx)
|
||||||
log.info(f'servicing transaction request {job.request.__class__.__name__} {job.id} with tx {ctx.id}')
|
log.info(f'servicing transaction request {job.request.__class__.__name__} {job.id} with tx {ctx.id}')
|
||||||
|
|
||||||
|
# todo sign-and-send should be a single phase. if the send fails due to lack of wallet gas, or because gas price went up suddenly,
|
||||||
|
# we need to re-sign a new message with updated gas. so do not store signed messages but keep the unsigned state around until it
|
||||||
|
# is signed and sent
|
||||||
async def send_transactions():
|
async def send_transactions():
|
||||||
w3 = current_w3.get()
|
w3 = current_w3.get()
|
||||||
for job in db.session.query(TransactionJob).filter(
|
for job in db.session.query(TransactionJob).filter(
|
||||||
|
|||||||
Reference in New Issue
Block a user