dipdup-io / dipdup

Modular framework for creating selective indexers and featureful backends for dapps
https://dipdup.io
MIT License
92 stars 52 forks source link

Data types in SubsquidEventData and EvmNodeLogData are different #837

Closed scottincrypto closed 1 year ago

scottincrypto commented 1 year ago

Steps to reproduce: Log events using subsquid archive -> event_index & transaction_index are type int, topics is tuple(str) Log events using live evm node -> event_index & transaction_index are type str, topics is list(str)

Also, it appears as though the block number is called block_number in EvmNodeData, and level in SubsquidEventData

What did you expect to happen: Consistent data types & variable names between these as they are interchangeable due to:

class SubsquidEvent(Generic[PayloadT]):
    data: SubsquidEventData | EvmNodeLogData
    payload: PayloadT

What actually happened: See above - data types are different, and block number is a different variable name

I'm happy to have a go at a PR for this issue, let me know which direction you'd like it to go (as per SubsquidEventData or EvmNodeLogData)

Environment

droserasprout commented 1 year ago

Thanks, @scottincrypto! I've pushed a fix in linked PR; give it a look if you have spare time.

scottincrypto commented 1 year ago

Thanks @droserasprout , that's fixed it nicely. Appreciate the quick fix, thanks!

scottincrypto commented 1 year ago

Closed