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

Wrap NW Cert in versioned enum #9878

Merged
merged 2 commits into from
Mar 27, 2023
Merged

Wrap NW Cert in versioned enum #9878

merged 2 commits into from
Mar 27, 2023

Conversation

arun-koshy
Copy link
Contributor

Test Plan

Unit Test & Benchmark

@vercel
Copy link

vercel bot commented Mar 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Ignored Deployments
Name Status Preview Comments Updated
explorer ⬜️ Ignored (Inspect) Mar 27, 2023 at 7:43PM (UTC)
explorer-storybook ⬜️ Ignored (Inspect) Mar 27, 2023 at 7:43PM (UTC)
wallet-adapter ⬜️ Ignored (Inspect) Mar 27, 2023 at 7:43PM (UTC)

Copy link
Contributor

@mwtian mwtian left a comment

Choose a reason for hiding this comment

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

LGTM. Fix CI then pick into 0.29?

let mut ret = self.header.digest() == other.header.digest();
match (self, other) {
(Certificate::V1(data), Certificate::V1(other_data)) => data.eq(other_data),
_ => false,
Copy link
Contributor

@mwtian mwtian Mar 27, 2023

Choose a reason for hiding this comment

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

Just remove the false variant for now? We can add it back in future. One way to avoid missing variant, is to only add match arms for (Certificate::Vi(data), Certificate::Vi(other_data)) and (Certificate::Vi(data), _), and not add match arm for _.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually thats a good point, I will remove all wildcard checks for now and if anyone adds a variant the rust compiler will complain and notify us to update this as well.

@arun-koshy arun-koshy force-pushed the arun/cert-versioning branch from af3bd55 to af66292 Compare March 27, 2023 19:43
@mwtian mwtian merged commit 4882541 into main Mar 27, 2023
@mwtian mwtian deleted the arun/cert-versioning branch March 27, 2023 20:44
mwtian pushed a commit that referenced this pull request Mar 27, 2023
## Test Plan 

Unit Test & Benchmark
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