@@ -5,7 +5,6 @@ import Error "mo:base/Error";
5
5
import Option "mo:base/Option" ;
6
6
import Nat "mo:base/Nat" ;
7
7
import Text "mo:base/Text" ;
8
- import Array "mo:base/Array" ;
9
8
import Buffer "mo:base/Buffer" ;
10
9
import List "mo:base/List" ;
11
10
import Deque "mo:base/Deque" ;
@@ -53,7 +52,7 @@ shared (creator) actor class Self(opt_params : ?Types.InitParams) = this {
53
52
};
54
53
pool. unshare(stablePool, stableMetadata, stableChildren);
55
54
for (info in stableTimers. vals()) {
56
- updateTimer(info);
55
+ updateTimer< system > (info);
57
56
};
58
57
statsByOrigin. unshare(stableStatsByOrigin);
59
58
};
@@ -73,13 +72,13 @@ shared (creator) actor class Self(opt_params : ?Types.InitParams) = this {
73
72
74
73
public func wallet_receive() : async () {
75
74
let amount = Cycles . available();
76
- ignore Cycles . accept amount;
75
+ ignore Cycles . accept< system > amount;
77
76
};
78
77
79
78
private func getExpiredCanisterInfo(origin : Logs . Origin ) : async Types . CanisterInfo {
80
79
switch (pool. getExpiredCanisterId()) {
81
80
case (#newId) {
82
- Cycles . add(params. cycles_per_canister);
81
+ Cycles . add< system > (params. cycles_per_canister);
83
82
let cid = await IC . create_canister { settings = null };
84
83
let now = Time . now();
85
84
let info = { id = cid. canister_id; timestamp = now };
@@ -95,7 +94,7 @@ shared (creator) actor class Self(opt_params : ?Types.InitParams) = this {
95
94
params. cycles_per_canister - status. cycles;
96
95
} else { 0 };
97
96
if (topUpCycles > 0 ) {
98
- Cycles . add topUpCycles;
97
+ Cycles . add< system > topUpCycles;
99
98
await IC . deposit_cycles cid;
100
99
};
101
100
if (Option . isSome(status. module_hash)) {
@@ -206,22 +205,22 @@ shared (creator) actor class Self(opt_params : ?Types.InitParams) = this {
206
205
statsByOrigin. addInstall(origin);
207
206
switch (pool. refresh(info, install_config. profiling)) {
208
207
case (?newInfo) {
209
- updateTimer(newInfo);
208
+ updateTimer< system > (newInfo);
210
209
newInfo;
211
210
};
212
211
case null { throw Error . reject "Cannot find canister" };
213
212
};
214
213
};
215
214
};
216
215
217
- func updateTimer(info: Types . CanisterInfo ) {
216
+ func updateTimer< system > (info: Types . CanisterInfo ) {
218
217
func job() : async () {
219
- pool. removeTimer(info. id);
218
+ pool. removeTimer< system > (info. id);
220
219
// It is important that the timer job checks for the timestamp first.
221
220
// This prevents late-runner jobs from deleting newly installed code.
222
221
await removeCode(info);
223
222
};
224
- pool. updateTimer(info, job);
223
+ pool. updateTimer< system > (info, job);
225
224
};
226
225
227
226
public func callForward(info : Types . CanisterInfo , function : Text , args : Blob ) : async Blob {
@@ -359,9 +358,9 @@ shared (creator) actor class Self(opt_params : ?Types.InitParams) = this {
359
358
};
360
359
361
360
// Disabled to prevent the user from updating the controller list (amongst other settings)
362
- public shared ({ caller }) func update_settings({
363
- canister_id : ICType . canister_id;
364
- settings : ICType . canister_settings;
361
+ public shared func update_settings({
362
+ _canister_id : ICType . canister_id;
363
+ _settings : ICType . canister_settings;
365
364
}) : async () {
366
365
throw Error . reject "Cannot call update_settings from within Motoko Playground" ;
367
366
};
0 commit comments