flow-cli icon indicating copy to clipboard operation
flow-cli copied to clipboard

Flags issue on flow event get command

Open WHYTEWYLL opened this issue 2 years ago • 5 comments

Problem

A CLI issue has been discovered with the "flow event get" command, specifically when using the "start" and "end" flags. It's worth noting that the error occurs regardless of whether the start or end value is greater or smaller than the other.

❌ Invalid argument: invalid query: start block must be <= end block

Steps to Reproduce

Just use the "flow event get" command with the start and end flags.

image

Context

I want to get the Tokenmint events associate with Flow.

WHYTEWYLL avatar May 04 '23 20:05 WHYTEWYLL

I can't seem to reproduce the issue. Can you share which version of the Flow CLI you use? Can you validate this works for you flow events get A.1e3c78c6d580273b.LNVCT.Deposit --start 51856180 --end 51856183 -n mainnet (a command that works with the latest version of Flow CLI).

devbugging avatar May 05 '23 08:05 devbugging

image

WHYTEWYLL avatar May 05 '23 21:05 WHYTEWYLL

@WHYTEWYLL you are sending command to emulator ( you need to send to mainnet like in @sideninja example), but block range and contract address doesn't seem to make sense.

As end height probably too big to emulator, emulator is cutting range to latest block height of emulator. Then you end up with something like ( 2829155 - 100 etc ) range, then API giving error start height is too big.

bluesign avatar May 07 '23 13:05 bluesign

The current range seems nonsensical, as every input triggers the same error message. It's perplexing that the error persists regardless of whether the range is appropriate or not. If the range is too large, the system should indicate this as well. Assuming your statement is accurate, this seems to be the case.

WHYTEWYLL avatar May 09 '23 07:05 WHYTEWYLL

We will look into conveying a more meaningful message when the range is too big, however, given a normal range it should work. cc @chasefleming

devbugging avatar May 09 '23 11:05 devbugging