neo-one-suite / neo-one

The One for easy, fast, & fun NEO app development.
https://neo-one.io
MIT License
93 stars 34 forks source link

Fix Nep17Transfer lookups #2553

Open spencercorwin opened 2 years ago

spencercorwin commented 2 years ago

When looking up Nep17Transfers with the RPC method 'getnep17transfers' I noticed strange behavior when trying to get all nep 17 transfers for a certain address in between startTime and endTime. It doesn't work correctly. Storage lookup params change when we pass each max byte mark. ie. 0 to 255 time is different than 0 to 256. Going into detail here would be very verbose. But it's not the expected behavior. To figure out what the search range keys are supposed to look like we need to see the exact bytes that are used in the neo-modules C# version. And need to understand better how storage iterator lookups work. We may need to create a Nep17TransferKey() object for the lookup and serialize it with zeros after the scripthash and timestampMS are serialized.