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

Move Hashed to linera-base. #3064

Merged
merged 3 commits into from
Dec 19, 2024
Merged

Move Hashed to linera-base. #3064

merged 3 commits into from
Dec 19, 2024

Conversation

afck
Copy link
Contributor

@afck afck commented Dec 19, 2024

Motivation

We are going to use Hashed for blobs, too, not only for certificate values.

Proposal

Move it to linera-base.

Remove the lite method and create a LiteValue::new instead.

Also, rename CertificateValueT to CertificateValue.

Test Plan

CI should catch regressions.

Release Plan

  • Nothing to do / These changes follow the usual release cycle.

Links

@afck afck merged commit 8464e81 into linera-io:main Dec 19, 2024
23 checks passed
@afck afck deleted the blobs-hashed branch December 19, 2024 19:17
@@ -439,6 +441,16 @@ pub struct LiteValue {
pub kind: CertificateKind,
}

impl LiteValue {
pub fn new<T: CertificateValue>(value: &Hashed<T>) -> Self {
Copy link
Contributor

@ma2bd ma2bd Dec 20, 2024

Choose a reason for hiding this comment

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

nit: This contructor is a bit weird. What was the issue with .lite()? Would a conversion From make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can change it to a conversion.

The issue with .lite() is that I can't define the method in linera-chain because Hashed is now in linera-base. And I can't define it in linera-base because it needs the CertificateValue trait, which is in linera-chain.

Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I don't like From conversions which are not obvious. It makes it difficult to track the flow - it's impossible to look for w/ IDE's "find usage/references" feature.

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.

3 participants