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

feat: specify ic0.call_cycles_try_add128 #342

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mraszyk
Copy link
Contributor

@mraszyk mraszyk commented Sep 28, 2024

This PR specifies a new system API ic0.call_cycles_try_add128 which behaves analogously to ic0.call_cycles_add128, but does not trap if the canister balance would decrease below the canister's freezing limit after transferring the specified amount of cycles onto the call. Since a canister cannot reliably derive its freezing limit, this new system API is necessary to avoid spurious traps when attaching cycles onto a call.

This PR also specifies to abort the call builder pattern in case of an error since otherwise the developer would not be able to cleanly abort the call in case of an error.

@mraszyk mraszyk requested a review from a team as a code owner September 28, 2024 17:36
Copy link

github-actions bot commented Sep 28, 2024

🤖 Here's your preview: https://pv4ef-vqaaa-aaaak-qidga-cai.icp0.io/docs

@mraszyk mraszyk requested a review from dsarlis October 1, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant