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

feat(storage): do not require Default for derive(Compact) #3419

Merged
merged 2 commits into from
Jun 27, 2023

Conversation

shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented Jun 27, 2023

Default was only needed to initalize a variable that will be instantly replaced, but it meant that we need to implement Default for all field types. It's inconvenient with enums as they often don't have any meaningful default value.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

I think this would be fine, can still add this manually, outside the compact macro

@shekhirin shekhirin marked this pull request as ready for review June 27, 2023 12:31
Copy link
Collaborator

@joshieDo joshieDo left a comment

Choose a reason for hiding this comment

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

lgtm

@codecov
Copy link

codecov bot commented Jun 27, 2023

Codecov Report

Merging #3419 (f7916a5) into main (085a703) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

Impacted Files Coverage Δ
crates/storage/codecs/derive/src/compact/enums.rs 75.58% <100.00%> (ø)
crates/storage/codecs/derive/src/compact/mod.rs 94.75% <100.00%> (-0.03%) ⬇️
...rates/storage/codecs/derive/src/compact/structs.rs 81.57% <100.00%> (ø)

... and 7 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.29% <28.00%> (-0.01%) ⬇️
unit-tests 64.30% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
reth binary 23.46% <ø> (ø)
blockchain tree 81.36% <ø> (ø)
pipeline 88.02% <ø> (ø)
storage (db) 73.99% <100.00%> (-0.01%) ⬇️
trie 95.64% <ø> (ø)
txpool 51.88% <ø> (+0.64%) ⬆️
networking 77.87% <ø> (-0.04%) ⬇️
rpc 58.09% <ø> (ø)
consensus/evm 46.83% <ø> (ø)
payload builder 6.83% <ø> (ø)
primitives 88.61% <ø> (-0.02%) ⬇️

@shekhirin shekhirin added this pull request to the merge queue Jun 27, 2023
Merged via the queue into main with commit 0a6b018 Jun 27, 2023
@shekhirin shekhirin deleted the alexey/derive-compact-default branch June 27, 2023 14:38
@onbjerg onbjerg added the C-debt Refactor of code section that is hard to understand or maintain label Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-debt Refactor of code section that is hard to understand or maintain
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants