Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cast returns no log if block numbers are not provided or only a to-block is provided #7729

Closed
2 tasks done
mds1 opened this issue Apr 19, 2024 · 2 comments · Fixed by #7731
Closed
2 tasks done

cast returns no log if block numbers are not provided or only a to-block is provided #7729

mds1 opened this issue Apr 19, 2024 · 2 comments · Fixed by #7731
Labels
T-bug Type: bug

Comments

@mds1
Copy link
Collaborator

mds1 commented Apr 19, 2024

Component

Cast

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

cast 0.2.0 (79dd88c 2024-04-19T00:21:49.496222000Z)

What command(s) is the bug in?

cast logs

Operating System

None

Describe the bug

Current behavior

# Provide a from block AND a to block, logs are returned
cast logs 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498 \
  --address 0x034edD2A225f7f429A63E0f1D2084B9E0A93b538 \
  --from-block 0 --to-block latest -r $SEPOLIA_RPC_URL

# Provide only a from block, logs are returned
cast logs 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498 \
  --address 0x034edD2A225f7f429A63E0f1D2084B9E0A93b538 \
  --from-block 0 -r $SEPOLIA_RPC_URL

# Provide only a to block, no logs are returned
cast logs 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498 \
  --address 0x034edD2A225f7f429A63E0f1D2084B9E0A93b538 \
  --to-block latest -r $SEPOLIA_RPC_URL

# Provide no from or to block, no logs are returned
cast logs 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498 \
  --address 0x034edD2A225f7f429A63E0f1D2084B9E0A93b538 \
  -r $SEPOLIA_RPC_URL

Expected Behavior

All cases should return the same set of logs, by defaulting to block 0 if no from block is provided, and defaulting to latest when no to block is provided

@kamuik16
Copy link
Contributor

hey @mds1! Opened a PR #7731 for this.

@mds1
Copy link
Collaborator Author

mds1 commented Apr 23, 2024

Thank you @kamuik16!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants