For Rust, whats the correct way of handling the Reject response.
I want to undo a state change if this call fails, but the canister gets in a reject callback mode and wont undo/revert the state via my function.
dfx 0.8.1
using ic-cdk = “0.2.4”
match
ic_cdk::call(canister_id, "transfer_notification", (
TransferNotification{
to: canister_id,
from: ic_cdk::caller(),
token_id: token_id,
amount: 1
},)
).await as CallResult<()> {
Ok(_) => return true,
Err(_) => {
//gets in rejected state is not executed completely
//address_book.undo_transfer(user_id, token_id);
return false;
}
}
Thanks!