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

parseJson with key of "." errors. #5422

Closed
2 tasks done
Tracked by #3801
DavidOrchard opened this issue Jul 17, 2023 · 0 comments · Fixed by #5426
Closed
2 tasks done
Tracked by #3801

parseJson with key of "." errors. #5422

DavidOrchard opened this issue Jul 17, 2023 · 0 comments · Fixed by #5426
Assignees
Labels
T-bug Type: bug
Milestone

Comments

@DavidOrchard
Copy link

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (08a629a 2023-06-03T00:14:26.563741000Z)

What command(s) is the bug in?

forge test

Operating System

macOS (Apple Silicon)

Describe the bug

The jq docs at https://jqlang.github.io/jq/manual/#Basicfilters say that a key of "." should return the whole object, but instead

        bytes memory transactionDetails = vm.parseJson(json, ".");

causes

[FAIL. Reason: path error: 
$.
^^
] testParseJson() (gas: 6104)

I've forked and made a PR that adds the failing test. foundry-rs/forge-std#420.

I did the fork & branch against forge-std as I'm new to solidity/forge and couldn't get the foundry/forge solidity tests to run.

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

Successfully merging a pull request may close this issue.

2 participants