-
Notifications
You must be signed in to change notification settings - Fork 14
feat: add size proof field in datalayer metadata #296
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
Conversation
@@ -113,6 +114,7 @@ pub struct DataStoreMetadata { | |||
pub label: Option<String>, | |||
pub description: Option<String>, | |||
pub bytes: Option<u64>, | |||
pub size_proof: Option<Bytes32>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you 100% certain that size proofs will be 32 bytes long?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should have been string like the description. this was fixed
@@ -125,6 +127,7 @@ impl<N, D: ClvmDecoder<Node = N>> FromClvm<D> for DataStoreMetadata { | |||
"l" => metadata.label = Some(String::from_clvm(decoder, ptr)?), | |||
"d" => metadata.description = Some(String::from_clvm(decoder, ptr)?), | |||
"b" => metadata.bytes = Some(u64::from_clvm(decoder, ptr)?), | |||
"p" => metadata.size_proof = Some(Bytes32::from_clvm(decoder, ptr)?), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
easy to mistake with CATalog precision; I would suggest sp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -149,6 +152,10 @@ impl<N, E: ClvmEncoder<Node = N>> ToClvm<E> for DataStoreMetadata { | |||
items.push(("b", Raw(bytes.to_clvm(encoder)?))); | |||
} | |||
|
|||
if let Some(size_proof) = self.size_proof { | |||
items.push(("p", Raw(size_proof.to_clvm(encoder)?))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Adds a new metadata field to the datalayer store singleton called "size_proof"