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

fix(cheatcodes): convert fixed bytes to bytes in vm.rpc tuple result #9117

Merged
merged 3 commits into from
Oct 16, 2024

Conversation

grandizzy
Copy link
Collaborator

Motivation

Closes #7858

Solution

  • convert fixed bytes to bytes in tuple result, similar to single fixed bytes result

@grandizzy grandizzy marked this pull request as ready for review October 15, 2024 07:46
Copy link
Member

@yash-atreya yash-atreya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

// Convert fixed bytes to bytes in tuple to prevent encoding issues.
// See: <https://github.com/foundry-rs/foundry/issues/7858>
if let DynSolValue::FixedBytes(bytes, size) = *val {
*val = DynSolValue::Bytes(bytes.as_slice()[..size].to_vec());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls just extract the function and make it recursive

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed in f38f578, please check

@grandizzy grandizzy merged commit 3786b27 into foundry-rs:master Oct 16, 2024
21 checks passed
@grandizzy grandizzy deleted the issue-7858 branch October 16, 2024 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

bug(cheatcodes): calling eth_getTransactionByHash with rpc cheatcode failed
3 participants