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

Open
dj8yfo opened this issue Feb 8, 2025 · 3 comments · May be fixed by #1313
Open

[Task] document callback_unwrap #1303

dj8yfo opened this issue Feb 8, 2025 · 3 comments · May be 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

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).
@TobieTom TobieTom linked a pull request Feb 19, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: NEW❗
Development

Successfully merging a pull request may close this issue.

3 participants