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

fix: Use node representation for Block #2746

Conversation

fredcarle
Copy link
Collaborator

Relevant issue(s)

Resolves #2745

Description

This PR ensures that the node being passed to the link system is in it's representation form. This will allow the use of optional fields.

Node that the 2 added block unit tests are there to cover when the optional isEncrypted field will be added to Block ipld schema.

Tasks

  • I made sure the code is well commented, particularly hard-to-understand areas.
  • I made sure the repository-held documentation is changed accordingly.
  • I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in tools/configs/chglog/config.yml).
  • I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ...

How has this been tested?

make test

Specify the platform(s) on which this was tested:

  • MacOS

@fredcarle fredcarle added the bug Something isn't working label Jun 20, 2024
@fredcarle fredcarle added this to the DefraDB v0.12 milestone Jun 20, 2024
@fredcarle fredcarle requested a review from a team June 20, 2024 21:25
@fredcarle fredcarle self-assigned this Jun 20, 2024
@fredcarle fredcarle changed the title fix: Use node representation for Block fix: Use node representation for Block Jun 20, 2024
Copy link
Contributor

@islamaliev islamaliev left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks for a quick fix

@@ -30,7 +30,7 @@ import (
// Schema is the IPLD schema type that represents a `Block`.
var (
Schema schema.Type
SchemaPrototype schema.TypedPrototype
SchemaPrototype ipld.NodePrototype
Copy link
Contributor

Choose a reason for hiding this comment

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

question: I wonder where this ipld coming from. I don't see any import that ends with "ipld"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

go-ipld-prime is the package 🙂

Copy link
Member

@nasdf nasdf left a comment

Choose a reason for hiding this comment

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

LGTM.

@fredcarle fredcarle merged commit 77af4fc into sourcenetwork:develop Jun 21, 2024
34 of 36 checks passed
@fredcarle fredcarle deleted the fredcarle/fix/ipld-node-representation branch June 21, 2024 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Block node representation should use representation form.
3 participants