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

max 900 bytes #21

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

max 900 bytes #21

wants to merge 2 commits into from

Conversation

dauphin3
Copy link
Collaborator

@dauphin3 dauphin3 commented Mar 1, 2022

fixes #7

@@ -32,7 +32,8 @@ const LINK_TAG_ARROW_REVERSE: [u8; 3] = [226, 134, 169]; // Unicode "↩" // hex
#[hdk_entry(id = "extra", visibility = "public")]
#[derive(Clone)]
pub struct Extra {
pub fields: BTreeMap<String, String>, // extra content
pub content_overflow: Option<String>,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pub content_overflow: Option<String>,
pub full_content: Option<String>,

@@ -32,7 +32,8 @@ const LINK_TAG_ARROW_REVERSE: [u8; 3] = [226, 134, 169]; // Unicode "↩" // hex
#[hdk_entry(id = "extra", visibility = "public")]
#[derive(Clone)]
pub struct Extra {
pub fields: BTreeMap<String, String>, // extra content
pub content_overflow: Option<String>,
pub extra_fields: Option<BTreeMap<String, String>>, // extra content
Copy link
Member

Choose a reason for hiding this comment

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

would just be empty if nothing in there:

Suggested change
pub extra_fields: Option<BTreeMap<String, String>>, // extra content
pub extra_fields: BTreeMap<String, String>, // extra content

@@ -413,7 +413,8 @@ pub async fn test_get_extra() {
.await;
Copy link
Member

Choose a reason for hiding this comment

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

let's have a test that pushes in 1000 bytes of content, and:

  • ensure that we get an extra hash in the link tag
  • retrieve the content from the extra entry and validate that it is correct

@harlantwood
Copy link
Member

@dauphin3 made some comments

Harlan T Wood and others added 2 commits July 3, 2024 16:24
- Modify `Extra` struct to include `content_overflow` and optional `extra_fields`
- Update `create` function to handle content overflow
- Refactor `create_extra` to accommodate new `Extra` structure
- Adjust `create_link_tag` to truncate long content and handle new chunk structure
- Update query functions to use new link tag format
- Modify tests to reflect changes in `Extra` struct

Co-authored-by: Zeek <[email protected]>
Co-authored-by: Zeek <[email protected]>
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.

TrustAtoms allow content over 900 bytes, stored in "extra" entry
2 participants