refactor(ledger): flatten code shred and data shred field nesting #332
+232
−196
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #212
fields
were being accessed, switched it to get the fields directly from the shred struct. soshred.fields.common
is nowshreds.common
fields
outside shred.zig, analogous methods were added to DataShred and CodeShred to serve the same purpose. this is in service to the point above, so things likeshred.fields.merkleRoot()
are nowshred.merkleRoot()
generic_shred
. other shred structs that used to callself.fields.function()
now callgeneric.function(self)
default
initializers in the shred structs tozeroedForTest
since the output data is actually an invalid shred and should probably not be used for anything. it's barely distinguishable from initializing the data as undefined. In the future i think these methods should be replaced with a way to initialize well-formed shreds. For now, we need it for tests, so I'd like it to be named in a way that indicates clearly what it does and what it's for, rather than implying it is a well-formed "default."