ChainSafe / ChainSafe/gossamer

Add fuzz tests to `pkg/scale`

Open
#2,630 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
454
Forks
144
PR merge metrics
No merged PRs in 30d

Description

## Task summary

#2629 was found randomly by adding a bad test case when writing tests for the trie proofs; this should not be found randomly and we should make use of fuzz tests instead. This is especially more important since we export it as `pkg/scale`, so other projects would be potentially affected.

- Add fuzz tests to check for panics for the decoder
- Add fuzz tests for the encoder + decoder
- Add fuzz tests to CI workflow

Contributor guide

Open the contributing guide

Research direction

Start in pkg/scale by locating the decoder and encoder entry points and review existing trie-proof tests, especially the regression context from #2629. Add fuzz coverage for decoder panics and encoder/decoder behavior, then update the CI workflow so the fuzz tests run there; done means the tests execute successfully in CI.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
ci-cd, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.