Skip to content

Commit

Permalink
update promise_yield_resume host fn signature
Browse files Browse the repository at this point in the history
  • Loading branch information
saketh-are committed Mar 1, 2024
1 parent 2b19c0a commit 6b60b2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions near-sdk/src/environment/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,14 +512,14 @@ pub fn promise_yield_create(
}

// TODO: return some kind of success/failure result
pub fn promise_yield_resume(data_id: &CryptoHash, data: &[u8]) {
pub fn promise_yield_resume(data_id: &CryptoHash, data: &[u8]) -> bool {
unsafe {
sys::promise_yield_resume(
data_id.len() as _,
data_id.as_ptr() as _,
data.len() as _,
data.as_ptr() as _,
)
) != 0
}
}

Expand Down
8 changes: 4 additions & 4 deletions near-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ extern "C" {
beneficiary_id_len: u64,
beneficiary_id_ptr: u64,
);
// #######################
// # Promise API await/submit #
// #######################
// ########################
// # Promise yield/resume #
// ########################
pub fn promise_yield_create(
function_name_len: u64,
function_name_ptr: u64,
Expand All @@ -163,7 +163,7 @@ extern "C" {
data_id_ptr: u64,
payload_len: u64,
payload_ptr: u64,
);
) -> u32;
// #######################
// # Promise API results #
// #######################
Expand Down

0 comments on commit 6b60b2f

Please sign in to comment.