cryo icon indicating copy to clipboard operation
cryo copied to clipboard

use --to-address and --from-address for filtering

Open sslivkoff opened this issue 1 year ago • 6 comments

currently --to-address and --from-address only are used for eth_calls and trace_calls datasets

but they should also be usable for filtering

relevant datasets

  • txs
  • traces
  • native_transfers
  • erc20_transfers
  • erc721_transfers

sslivkoff avatar Nov 03 '23 17:11 sslivkoff

Hi. If you don't mind can I take this task?

cool-mestorf avatar Nov 04 '23 10:11 cool-mestorf

that would be great

I think this is probably the best solution path

  • define an optional_parameters() function that specifies which optional parameters each of these datasets should take. see logs.rs or erc20_transfers.rs for examples. this makes it so that in the extract() function for each dataset, the request object can now return request.to_address() and request.from_address()
  • the extract() function should be modified to skip the data that doesn't satisfy the filter. for txs dataset this will require modifying the Response type to be optional and modifying the process_transactions function. for the other datasets, no modification required, can just return an empty list from extract

sslivkoff avatar Nov 04 '23 15:11 sslivkoff

I struggled a while to take from_address arg into new Dim... but found it quite tricky. I will try to stick on implementing easier filters first, to_address and maybe erc transfers first.

cool-mestorf avatar Nov 08 '23 16:11 cool-mestorf

oh right, I forgot that from_address was removed from the Dim. yea to_address would be a good start

where are the difficulties with from_address coming from?

sslivkoff avatar Nov 08 '23 16:11 sslivkoff

Even I define dim and optional args for from_address the supplied argument does not seem to be passed to query. If debugging takes too long I will try to open a draft PR and ask for comments.

cool-mestorf avatar Nov 09 '23 01:11 cool-mestorf

Maybe this issue can be closed now?

cool-mestorf avatar Nov 17 '23 01:11 cool-mestorf