kopia lustrzana https://github.com/bugout-dev/moonstream
Made contract update crawler idempotent
Had forgotten to add a check before so that it wouldn't reprocess old transactions. Fixed now.pull/27/head
rodzic
67e3135386
commit
ad37dbd464
|
@ -128,10 +128,19 @@ def process_contract_deployments() -> List[Tuple[str, str]]:
|
||||||
current_offset = 0
|
current_offset = 0
|
||||||
limit = 10
|
limit = 10
|
||||||
transactions_remaining = True
|
transactions_remaining = True
|
||||||
|
existing_contract_transaction_hashes = db_session.query(
|
||||||
|
EthereumSmartContract.transaction_hash
|
||||||
|
)
|
||||||
|
|
||||||
while transactions_remaining:
|
while transactions_remaining:
|
||||||
contract_deployments = (
|
contract_deployments = (
|
||||||
db_session.query(EthereumTransaction)
|
db_session.query(EthereumTransaction)
|
||||||
.order_by(desc(EthereumTransaction.block_number))
|
.order_by(desc(EthereumTransaction.block_number))
|
||||||
|
.filter(
|
||||||
|
EthereumTransaction.hash.notin_(
|
||||||
|
existing_contract_transaction_hashes
|
||||||
|
)
|
||||||
|
)
|
||||||
.filter(EthereumTransaction.to_address == None)
|
.filter(EthereumTransaction.to_address == None)
|
||||||
.limit(limit)
|
.limit(limit)
|
||||||
.offset(current_offset)
|
.offset(current_offset)
|
||||||
|
|
Ładowanie…
Reference in New Issue