refactor(guides): move cycle-attachment content to inter-canister-calls#243
Conversation
|
Code review: one CLI command error found. All Motoko and Rust examples are correct:
Fix needed: The icp new proxy --template proxyThe correct flag is icp new proxy --subfolder proxyVerified against |
- Fix --template -> --subfolder flag on icp new (per cli reference) - Extend accepting-cycles example to require a specific fee and accept exactly that amount; excess is returned to the caller automatically
|
Feedback addressed:
|
|
Re-reviewed after the follow-up commit. All examples are correct: CLI fix: Improved callee pattern: the new fee-based accept is correct on both sides.
All Motoko/Rust imports, anchor links, and the |
| import Cycles "mo:core/Cycles"; | ||
| import Runtime "mo:core/Runtime"; | ||
|
|
||
| persistent actor { |
There was a problem hiding this comment.
we're not removing persistent?
There was a problem hiding this comment.
I have an issue open to apply modern style Motoko on all shown snippets where this would also be covered: #232
however, I think it should become default behavior in the compiler instead of having to explain why the flag needs to be passed. in theory we should explain this behavior in every snippet where actor is used without persistence keyword.
or we just don't care if somebody copies the actor only snippet without knowing about --default-persistent-actors 😅 but yes, I would like to remove the keyword everywhere.
see also my question on Slack.
Summary
## Calling canisters that require cyclessection out of the cycles-management guide and into inter-canister-calls as a new## Calls with attached cyclessection. Attaching cycles to a call is a call mechanic, not an operational management concern.### Accepting cycles in your canistersubsection (which was under "Topping up canisters") to the same new section, since it is the callee-side of the same mechanic.Cycles.add<system>()imperative style to the current(with cycles = amount)parenthetical syntax, and updates the Rust examples from the low-levelmsg_cycles_addcall to.with_cycles()on theCallbuilder — consistent with how the rest ofinter-canister-calls.mdxis written.### Charging a cycle feeand the example function tocompute()returning(), making clear that cycles are payment for work rather than the subject of the function.icp new proxy --template proxy→icp new proxy --subfolder proxy(no--templateflag exists; verified against.sources/icp-cli/docs/reference/cli.md). The bug was present in the original section and carried over during the move.cycles-management.mdpointing to the new location.concepts/cycles.md(×2),guides/chain-fusion/exchange-rates.mdx(×2).Sync recommendation
hand-writtenCloses #231