kopia lustrzana https://github.com/bugout-dev/moonworm
Merge pull request #125 from moonstream-to/fix-moonstream-provider
Fix moonstream providermain v0.9.2
commit
e84092518d
|
@ -198,10 +198,7 @@ class FunctionCallCrawler:
|
||||||
method_id = transaction.get("input")[:10]
|
method_id = transaction.get("input")[:10]
|
||||||
if method_id in self.whitelisted_methods:
|
if method_id in self.whitelisted_methods:
|
||||||
self.process_transaction(transaction)
|
self.process_transaction(transaction)
|
||||||
else:
|
|
||||||
print(
|
|
||||||
f"Function not in ABI, MethodID: {method_id} tx: {transaction['hash'].hex()}. Ignored."
|
|
||||||
)
|
|
||||||
self.state.state
|
self.state.state
|
||||||
if flush_state:
|
if flush_state:
|
||||||
self.state.flush()
|
self.state.flush()
|
||||||
|
|
|
@ -69,11 +69,9 @@ class MoonstreamEthereumStateProvider(EthereumStateProvider):
|
||||||
return last_block.block_number
|
return last_block.block_number
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _transform_to_w3_tx(
|
def _transform_to_w3_tx(tx_raw: tx_raw_types, raw_block) -> Dict[str, Any]:
|
||||||
tx_raw: tx_raw_types,
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
tx = {
|
tx = {
|
||||||
"blockHash": tx_raw.block_hash,
|
"blockHash": raw_block.hash,
|
||||||
"blockNumber": tx_raw.block_number,
|
"blockNumber": tx_raw.block_number,
|
||||||
"from": tx_raw.from_address,
|
"from": tx_raw.from_address,
|
||||||
"gas": tx_raw.gas,
|
"gas": tx_raw.gas,
|
||||||
|
@ -134,7 +132,9 @@ class MoonstreamEthereumStateProvider(EthereumStateProvider):
|
||||||
for block, txs in block_transactions.items():
|
for block, txs in block_transactions.items():
|
||||||
self.blocks_cache[block] = {
|
self.blocks_cache[block] = {
|
||||||
"timestamp": blocks[block].timestamp,
|
"timestamp": blocks[block].timestamp,
|
||||||
"transactions": [self._transform_to_w3_tx(tx) for tx in txs],
|
"transactions": [
|
||||||
|
self._transform_to_w3_tx(tx, blocks[block]) for tx in txs
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
return self.blocks_cache[block_number]
|
return self.blocks_cache[block_number]
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
MOONWORM_VERSION = "0.9.1"
|
MOONWORM_VERSION = "0.9.2"
|
||||||
|
|
Ładowanie…
Reference in New Issue