Pass error through from trace to liquidation

This commit is contained in:
Luke Van Seters 2021-12-23 10:09:32 -05:00
parent 115167096e
commit 21826dd308
5 changed files with 7 additions and 1 deletions

View File

@ -70,6 +70,7 @@ def get_aave_liquidations(
transaction_hash=trace.transaction_hash, transaction_hash=trace.transaction_hash,
trace_address=trace.trace_address, trace_address=trace.trace_address,
block_number=trace.block_number, block_number=trace.block_number,
error=trace.error,
) )
) )

View File

@ -48,6 +48,7 @@ def get_compound_liquidations(
transaction_hash=trace.transaction_hash, transaction_hash=trace.transaction_hash,
trace_address=trace.trace_address, trace_address=trace.trace_address,
block_number=trace.block_number, block_number=trace.block_number,
error=trace.error,
) )
) )
elif ( elif (
@ -65,6 +66,7 @@ def get_compound_liquidations(
transaction_hash=trace.transaction_hash, transaction_hash=trace.transaction_hash,
trace_address=trace.trace_address, trace_address=trace.trace_address,
block_number=trace.block_number, block_number=trace.block_number,
error=trace.error,
) )
) )
return liquidations return liquidations

View File

@ -75,8 +75,9 @@ class MEVInspector:
except CancelledError: except CancelledError:
logger.info("Requested to exit, cleaning up...") logger.info("Requested to exit, cleaning up...")
except Exception as e: except Exception as e:
logger.error(f"Existed due to {type(e)}") logger.error(f"Exited due to {type(e)}")
traceback.print_exc() traceback.print_exc()
raise
async def safe_inspect_many_blocks( async def safe_inspect_many_blocks(
self, self,

View File

@ -16,3 +16,4 @@ class LiquidationModel(Base):
transaction_hash = Column(String, primary_key=True) transaction_hash = Column(String, primary_key=True)
trace_address = Column(ARRAY(Integer), primary_key=True) trace_address = Column(ARRAY(Integer), primary_key=True)
block_number = Column(Numeric, nullable=False) block_number = Column(Numeric, nullable=False)
error = Column(String, nullable=True)

View File

@ -16,3 +16,4 @@ class Liquidation(BaseModel):
transaction_hash: str transaction_hash: str
trace_address: List[int] trace_address: List[int]
block_number: str block_number: str
error: Optional[str]