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

[Task] document callback_unwrap #1303

Closed
dj8yfo opened this issue Feb 8, 2025 · 3 comments · Fixed by #1313
Closed

[Task] document callback_unwrap #1303

dj8yfo opened this issue Feb 8, 2025 · 3 comments · Fixed by #1313

Comments

@dj8yfo
Copy link
Collaborator

dj8yfo commented Feb 8, 2025

Background

Callback_unwrap can link to [PromiseOrValue] abstraction https://github.com/near/near-sdk-rs/blob/master/examples/cross-contract-calls/high-level/src/lib.rs#L26

User Story

Should have an anchor under #[near] macro doc with description of how it works and a few examples, and with links within repo, how it's used.

   near-sdk-rs
   ├──examples
   │  ├──cross-contract-calls
   │  │  └──high-level
   │  │     └──src
   │  │        └──lib.rs
   │  │           └──26:    pub fn factorial_mult(&self, n: u32, #[callback_unwrap] cur: u32) -> u32 {
   │  ├──adder
   │  │  └──src
   │  │     └──lib.rs
   │  │        ├──30:        #[callback_unwrap] a: DoublePair,
   │  │        └──31:        #[callback_unwrap] b: DoublePair,
   │  └──callback-results
   │     └──src
   │        └──lib.rs
-> │           └──51:        #[callback_unwrap] a: u8,

Acceptance Criteria

Resources & Additional Notes

No response

Priority

🔴 P4 : Normal

@7-falseparfait
Copy link

Mind if I take this issue?

@dj8yfo dj8yfo added the docs label Feb 13, 2025
@dj8yfo dj8yfo changed the title [Task] callback_unwrap -> PromiseOrValue [Task] document callback_unwrap Feb 16, 2025
@TobieTom
Copy link
Contributor

Hola Its Tobias. Im requesting for this task as requested

@dj8yfo dj8yfo assigned dj8yfo and TobieTom and unassigned dj8yfo Feb 19, 2025
@dj8yfo
Copy link
Collaborator Author

dj8yfo commented Feb 19, 2025

@TobieTom you could also try take #1312, if the current one ends in a success

@dj8yfo dj8yfo changed the title [Task] document callback_unwrap [Task] document callback_unwrap Feb 19, 2025
TobieTom added a commit to TobieTom/near-sdk-rs that referenced this issue Feb 19, 2025
Fixes near#1303

Adds documentation for the `callback_unwrap` attribute under the `#[near]` macro docs, including:

- Description of functionality and usage
- Integration with `PromiseOrValue`
- Cross-contract factorial example 
- Error handling alternatives
- Rust doc annotations and references

Resolves near#1303

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/near/near-sdk-rs/issues/1303?shareId=XXXX-XXXX-XXXX-XXXX).
dj8yfo pushed a commit that referenced this issue Feb 25, 2025
* docs: document `callback_unwrap` attribute

Fixes #1303

Adds documentation for the `callback_unwrap` attribute under the `#[near]` macro docs, including:

- Description of functionality and usage
- Integration with `PromiseOrValue`
- Cross-contract factorial example 
- Error handling alternatives
- Rust doc annotations and references

Resolves #1303

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/near/near-sdk-rs/issues/1303?shareId=XXXX-XXXX-XXXX-XXXX).

* comment: resolves #1313 (comment)

* comment: resolves #1313 (comment)

* comment: resolves #1313 (comment)

* comment: resolves #1313 (comment)

* comment: resolves #1313 (comment)

* comment: resolves #1313 (comment)

* comment: resolves #1313 (comment)

* snapshot: fix compilation test schemars 0.8.21 -> 0.8.22

---------

Co-authored-by: dj8yf0μl <noreply@nowhere.org>
@github-project-automation github-project-automation bot moved this from NEW❗ to Shipped 🚀 in DevTools Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Shipped 🚀
Development

Successfully merging a pull request may close this issue.

3 participants