|
9 | 9 |
|
10 | 10 | from common.utils.cache_utils import BlockToLiveDict, TimeToLiveDict |
11 | 11 | from common.utils.exception_control import FastShutdownError |
12 | | -from indexer.domain.block import Block |
| 12 | +from indexer.domain.transaction import Transaction |
13 | 13 | from indexer.jobs import FilterTransactionDataJob |
14 | 14 | from indexer.modules.custom.deposit_to_l2.deposit_parser import parse_deposit_transaction_function, token_parse_mapping |
15 | 15 | from indexer.modules.custom.deposit_to_l2.domain.address_token_deposit import AddressTokenDeposit |
|
21 | 21 |
|
22 | 22 |
|
23 | 23 | class DepositToL2Job(FilterTransactionDataJob): |
24 | | - dependency_types = [Block] |
| 24 | + dependency_types = [Transaction] |
25 | 25 | output_types = [TokenDepositTransaction, AddressTokenDeposit] |
26 | 26 | able_to_reorg = True |
27 | 27 |
|
@@ -86,7 +86,11 @@ def _process(self, **kwargs): |
86 | 86 | transactions = list( |
87 | 87 | filter( |
88 | 88 | self._filter.get_or_specification().is_satisfied_by, |
89 | | - [transaction for block in self._data_buff[Block.type()] for transaction in block.transactions], |
| 89 | + [ |
| 90 | + transaction |
| 91 | + for transaction in self._data_buff[Transaction.type()] |
| 92 | + if transaction.receipt and transaction.receipt.status != 0 |
| 93 | + ], |
90 | 94 | ) |
91 | 95 | ) |
92 | 96 | deposit_tokens = parse_deposit_transaction_function( |
@@ -162,13 +166,13 @@ def check_history_deposit_from_db( |
162 | 166 |
|
163 | 167 | deposit = ( |
164 | 168 | AddressTokenDeposit( |
165 | | - wallet_address=history_deposit.wallet_address, |
| 169 | + wallet_address="0x" + history_deposit.wallet_address.hex(), |
166 | 170 | chain_id=history_deposit.chain_id, |
167 | | - contract_address=history_deposit.contract_address, |
168 | | - token_address=history_deposit.token_address, |
169 | | - value=history_deposit.value, |
| 171 | + contract_address="0x" + history_deposit.contract_address.hex(), |
| 172 | + token_address="0x" + history_deposit.token_address.hex(), |
| 173 | + value=int(history_deposit.value), |
170 | 174 | block_number=history_deposit.block_number, |
171 | | - block_timestamp=history_deposit.block_timestamp, |
| 175 | + block_timestamp=int(round(history_deposit.block_timestamp.timestamp())), |
172 | 176 | ) |
173 | 177 | if history_deposit |
174 | 178 | else None |
|
0 commit comments