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

"this function call implicitly requires system capability and may perform undesired actions" #31

Open
vporton opened this issue Mar 14, 2024 · 1 comment

Comments

@vporton
Copy link

vporton commented Mar 14, 2024

.mops/[email protected]/src/CanisterActions.mo:60.9-60.28: warning [M0195], this function call implicitly requires systemcapability and may perform undesired actions (please review the call and provide a type instantiation to suppress this warning)

when compiling with

$ moc --version
Motoko compiler 0.11.0+ (source yh3wb1vx-vj8j4j32-k8gq4m8y-4cxlqinf)
@ByronBecker
Copy link
Contributor

This is from the transferCyclesStopAndDeleteCanisters API in CanDBAdmin.mo

public func transferCyclesStopAndDeleteCanisters(canisterIds: [Text]): async CanisterCleanupStatusMap {

It's used when you want to delete an array of canister ids in parallel. Essentially what it does is:

  /// 1. Calls the TransferCycles method of each canister actor (transferring cycles from your service partition canisters back to your CanDB Index canister actor)
  /// 2. Stops each canister
  /// 3. Deletes each canister

Step 1 is what's resulting in a system error, since the library is sending cycles.

You can also implement your own canister cycles cleanup if you want to avoid the warning, but I implemented it in the library so that you don't have to deal with it in the first place.

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

No branches or pull requests

2 participants