Expand description
Helper methods that often used in smart contracts.
Functionsยง
- assert_
one_ yocto - Assert that 1 yoctoNEAR was attached.
- assert_
self - Assert that predecessor_account_id == current_account_id, meaning contract called itself.
- is_
promise_ success - Returns true if promise was successful.
Fails if called outside a callback that received 1 promise result.
Uses low-level
crate::env::promise_results_count
. - promise_
result_ as_ success - Returns the result of the promise if successful. Otherwise returns None.
Fails if called outside a callback that received 1 promise result.
Uses low-level
crate::env::promise_results_count
andcrate::env::promise_result
.