Open
Description
A sample contract method
near-sdk-rs/examples/adder/src/lib.rs
Lines 40 to 49 in 3bdbdd3
behaves very strange with respect to handling arguments: an argument annotated with #[callback_vec]
comprises the values of previous arguments annotated with #[callback_unwrap]
:
near-sdk-rs/examples/adder/src/lib.rs
Lines 112 to 123 in 3bdbdd3
One would probably expect this argument to behave as a var-arg parameter with respect to Promise
-s:
// pseudo-code
fn handle_callbacks(a_promise, b_promise, *rest_of_the_promises)
=>
assert_eq!(composite_result.others, vec![Pair(3, 3), Pair(4, 4),]);
Possible changes/fixes:
- Simple
- disallow using
#[callback_vec]
with#[callback_unwrap]
/#[callback_result]
on other arguments - disallow using
#[callback_vec]
more that once on all of the arguments
- disallow using
- Less simple
- adjust starting promise idx computing for
#[callback_vec]
- disallow using
#[callback_vec]
more that once on all of the arguments - require
#[callback_vec]
to be used after all of the#[callback_unwrap]
/#[callback_result]
-s
- adjust starting promise idx computing for
Metadata
Metadata
Assignees
Type
Projects
Status
NEW❗