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

varint_read_u64 panics on unwrap in no_std environment #145

Merged
merged 2 commits into from
Oct 17, 2023

Conversation

mattheworris
Copy link
Contributor

The goal of this pull request is to refactor unwrap() to return the u64 value or anError:VarIntDecodeError in the no_std environment.

This error was discovered in fuzz testing.

Tests were refactored to include a new no_std_tests module, in order to test the fix.
cargo test --no-default-features will execute the no_std test.

Copy link
Member

@vmx vmx left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

@vmx vmx merged commit 86c7912 into multiformats:master Oct 17, 2023
7 checks passed
mattheworris added a commit to frequency-chain/frequency that referenced this pull request Oct 17, 2023
…vironment (#1719)

# Goal
The goal of this PR is to eliminate a panic discovered in fuzz testing.
Closes #1712 
# Discussion
A PR was created in `multiformats/rust-cid` and merged to refactor
`unwrap()` to return a Result in a `no_std` environment.
See PR here:
[multiformats/rust-cid/pull/145](multiformats/rust-cid#145)

`Cargo.toml` was updated to be pinned to the PR commit with the fix in
`rust-cid`

# Checklist
- [ ] Chain spec updated
- [ ] Custom RPC OR Runtime API added/changed? Updated js/api-augment.
- [ ] Design doc(s) updated
- [x] Tests added
- [ ] Benchmarks added
- [ ] Weights updated

---------

Co-authored-by: Matthew Orris <--help>
rustadot pushed a commit to rustadot/recurrency that referenced this pull request Sep 5, 2024
…vironment (#1719)

# Goal
The goal of this PR is to eliminate a panic discovered in fuzz testing.
Closes #1712 
# Discussion
A PR was created in `multiformats/rust-cid` and merged to refactor
`unwrap()` to return a Result in a `no_std` environment.
See PR here:
[multiformats/rust-cid/pull/145](multiformats/rust-cid#145)

`Cargo.toml` was updated to be pinned to the PR commit with the fix in
`rust-cid`

# Checklist
- [ ] Chain spec updated
- [ ] Custom RPC OR Runtime API added/changed? Updated js/api-augment.
- [ ] Design doc(s) updated
- [x] Tests added
- [ ] Benchmarks added
- [ ] Weights updated

---------

Co-authored-by: Matthew Orris <--help>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants