Skip to content

Conversation

MichaelTaylor3D
Copy link
Contributor

@MichaelTaylor3D MichaelTaylor3D commented Sep 7, 2025

Adds a new metadata field to the datalayer store singleton called "size_proof"

@@ -113,6 +114,7 @@ pub struct DataStoreMetadata {
pub label: Option<String>,
pub description: Option<String>,
pub bytes: Option<u64>,
pub size_proof: Option<Bytes32>,
Copy link
Collaborator

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?

Copy link
Contributor Author

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)?),
Copy link
Collaborator

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

Copy link
Contributor Author

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)?)));
Copy link
Collaborator

Choose a reason for hiding this comment

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

sp

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@Yakuhito Yakuhito merged commit 2f6749e into xch-dev:main Sep 8, 2025
28 checks passed
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