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

Reduce "shim types", introduce agreement.Block #21

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

jannotti
Copy link
Owner

agreement.Block is similar to what was agreement.ProposableBlock, but rather than being an interface it is a concrete type. Therefore, there can be no confusion: A validated block is not an agreement.Block just because it has a Block() method.

Instead, FinalizeBlock methods explicit copy their internal Block() objects into agreement.Block objects during finalization.

This PR also eliminates node.validatedBlock as
*ledgercore.ValidatedBlock implements agreement.ValidatedBlock already, no wrapper is needed. Blocks remain as immutable as before.

agreement.Block is similar to what was agreement.ProposableBlock, but
rather than being an interface it is a concrete type.  Therefore,
there can be no confusion: A validated block is not an agreement.Block
just because it has a Block() method.

Instead, FinalizeBlock methods explicit copy their internal Block()
objects into agreement.Block objects during finalization.

This PR also eliminates node.validatedBlock as
*ledgercore.ValidatedBlock implements agreement.ValidatedBlock
already, no wrapper is needed.  Blocks remain as immutable as before.
@jannotti jannotti merged commit 0a83e45 into absenteeism Apr 18, 2024
2 of 5 checks passed
jannotti added a commit that referenced this pull request Apr 18, 2024
Reduce "shim types", introduce agreement.Block
jannotti added a commit that referenced this pull request Apr 18, 2024
Reduce "shim types", introduce agreement.Block
@cce
Copy link

cce commented Apr 18, 2024

LGTM

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