Skip to content

Commit 476a143

Browse files
chore: Update to 0.29.0 (#1255)
1 parent 1eeb528 commit 476a143

File tree

44 files changed

+112
-109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+112
-109
lines changed

.github/workflows/provision-darwin.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ rm node.pkg
1818

1919
# Install DFINITY SDK.
2020
curl --location --output install-dfx.sh "https://raw.githubusercontent.com/dfinity/sdk/master/public/install-dfxvm.sh"
21-
DFX_VERSION=${DFX_VERSION:=0.28.0} DFXVM_INIT_YES=true bash install-dfx.sh
21+
DFX_VERSION=${DFX_VERSION:=0.29.0} DFXVM_INIT_YES=true bash install-dfx.sh
2222
rm install-dfx.sh
2323
echo "$HOME/Library/Application Support/org.dfinity.dfx/bin" >> $GITHUB_PATH
2424
source "$HOME/Library/Application Support/org.dfinity.dfx/env"
@@ -68,7 +68,7 @@ rm "wasmtime-v${wasmtime_version}-x86_64-macos.tar.xz"
6868

6969
# Install wasi2ic
7070
git clone https://github.com/wasm-forge/wasi2ic
71-
cargo install --path wasi2ic --root "${HOME}"
71+
cargo install --path wasi2ic --root "${HOME}" --locked
7272

7373
# Install wasm-opt
7474
version=117

.github/workflows/provision-linux.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ rm nodesource_setup.sh
1313

1414
# Install DFINITY SDK.
1515
wget --output-document install-dfx.sh "https://raw.githubusercontent.com/dfinity/sdk/master/public/install-dfxvm.sh"
16-
DFX_VERSION=${DFX_VERSION:=0.28.0} DFXVM_INIT_YES=true bash install-dfx.sh
16+
DFX_VERSION=${DFX_VERSION:=0.29.0} DFXVM_INIT_YES=true bash install-dfx.sh
1717
rm install-dfx.sh
1818
echo "$HOME/.local/share/dfx/bin" >>$GITHUB_PATH
1919
source "$HOME/.local/share/dfx/env"
@@ -62,7 +62,7 @@ rm "wasmtime-v${wasmtime_version}-x86_64-linux.tar.xz"
6262

6363
# Install wasi2ic
6464
git clone https://github.com/wasm-forge/wasi2ic
65-
cargo install --path wasi2ic --root "${HOME}"
65+
cargo install --path wasi2ic --root "${HOME}" --locked
6666

6767
# Install wasm-opt
6868
version=117

motoko/basic_bitcoin/src/basic_bitcoin/src/Main.mo

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import P2tr "P2tr";
1010
import Types "Types";
1111
import Utils "Utils";
1212

13-
actor class BasicBitcoin(network : Types.Network) {
13+
persistent actor class BasicBitcoin(network : Types.Network) {
1414
type GetUtxosResponse = Types.GetUtxosResponse;
1515
type MillisatoshiPerVByte = Types.MillisatoshiPerVByte;
1616
type SendRequest = Types.SendRequest;
@@ -27,14 +27,14 @@ actor class BasicBitcoin(network : Types.Network) {
2727
/// When developing locally this should be `regtest`.
2828
/// When deploying to the IC this should be `testnet`.
2929
/// `mainnet` is currently unsupported.
30-
stable let NETWORK : Network = network;
30+
let NETWORK : Network = network;
3131

3232
/// The derivation path to use for ECDSA secp256k1 or Schnorr BIP340/BIP341 key
3333
/// derivation.
34-
let DERIVATION_PATH : [[Nat8]] = [];
34+
transient let DERIVATION_PATH : [[Nat8]] = [];
3535

3636
// The ECDSA key name.
37-
let KEY_NAME : Text = switch NETWORK {
37+
transient let KEY_NAME : Text = switch NETWORK {
3838
// For local development, we use a special test key with dfx.
3939
case (#regtest) "dfx_test_key";
4040
// On the IC we're using a test ECDSA key.
@@ -43,8 +43,8 @@ actor class BasicBitcoin(network : Types.Network) {
4343

4444
// Threshold signing APIs instantiated with the management canister ID. Can be
4545
// replaced for cheaper testing.
46-
var ecdsa_canister_actor : EcdsaCanisterActor = actor ("aaaaa-aa");
47-
var schnorr_canister_actor : SchnorrCanisterActor = actor ("aaaaa-aa");
46+
transient var ecdsa_canister_actor : EcdsaCanisterActor = actor ("aaaaa-aa");
47+
transient var schnorr_canister_actor : SchnorrCanisterActor = actor ("aaaaa-aa");
4848

4949
/// Returns the balance of the given Bitcoin address.
5050
public func get_balance(address : BitcoinAddress) : async Satoshi {

motoko/canister_logs/src/Main.mo

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,24 @@ import { now } = "mo:base/Time";
44
import { setTimer; recurringTimer } = "mo:base/Timer";
55
import StableMemory "mo:base/ExperimentalStableMemory";
66

7-
actor CanisterLogs {
7+
persistent actor CanisterLogs {
88

9-
let timerDelaySeconds = 5;
10-
let second = 1_000_000_000;
11-
let ic00_raw_rand = (actor "aaaaa-aa" : actor { raw_rand : () -> async Blob }).raw_rand;
9+
transient let timerDelaySeconds = 5;
10+
transient let second = 1_000_000_000;
11+
transient let ic00_raw_rand = (actor "aaaaa-aa" : actor { raw_rand : () -> async Blob }).raw_rand;
1212

1313
private func execute_timer() : async () {
1414
Debug.print("right before timer trap");
1515
Debug.trap("timer trap");
1616
};
1717

18-
ignore setTimer<system>(#seconds (timerDelaySeconds - abs(now() / second) % timerDelaySeconds),
19-
func () : async () {
18+
ignore setTimer<system>(
19+
#seconds(timerDelaySeconds - abs(now() / second) % timerDelaySeconds),
20+
func() : async () {
2021
ignore recurringTimer<system>(#seconds timerDelaySeconds, execute_timer);
2122
await execute_timer();
22-
});
23+
},
24+
);
2325

2426
public func print(text : Text) : async () {
2527
Debug.print(text);
@@ -43,7 +45,7 @@ actor CanisterLogs {
4345
Debug.print("right before memory out of bounds");
4446
let offset : Nat64 = 10;
4547
let value : Nat = 20;
46-
let _blob = StableMemory.loadBlob(offset, value); // Expect reading outside of memory bounds to trap.
48+
let _blob = StableMemory.loadBlob(offset, value); // Expect reading outside of memory bounds to trap.
4749
};
4850

4951
public func raw_rand() : async Blob {

motoko/cert-var/src/cert_var/main.mo

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Nat8 "mo:base/Nat8";
66
import Nat32 "mo:base/Nat32";
77
import Debug "mo:base/Debug";
88

9-
actor Variable {
9+
persistent actor Variable {
1010

1111
var value : Nat32 = 0;
1212

@@ -15,13 +15,14 @@ actor Variable {
1515
func blobOfNat32(n : Nat32) : Blob {
1616
let byteMask : Nat32 = 0xff;
1717
func byte(x : Nat32) : Nat8 {
18-
Nat8.fromNat(Nat32.toNat(x))
18+
Nat8.fromNat(Nat32.toNat(x));
1919
};
20-
Blob.fromArray(
21-
[byte(((byteMask << 0 ) & value) >> 0),
22-
byte(((byteMask << 8 ) & value) >> 8),
23-
byte(((byteMask << 16) & value) >> 16),
24-
byte(((byteMask << 24) & value) >> 24)])
20+
Blob.fromArray([
21+
byte(((byteMask << 0) & value) >> 0),
22+
byte(((byteMask << 8) & value) >> 8),
23+
byte(((byteMask << 16) & value) >> 16),
24+
byte(((byteMask << 24) & value) >> 24),
25+
]);
2526
};
2627

2728
/// Update counter and certificate (via system).
@@ -41,6 +42,6 @@ actor Variable {
4142
/// When called via update call or inter-canister call, no certificate is present (and not needed,
4243
/// as in these cases the system already certifies the response)
4344
public query func get() : async { value : Nat32; certificate : ?Blob } {
44-
return { value; certificate = CD.getCertificate() }
45+
return { value; certificate = CD.getCertificate() };
4546
};
46-
}
47+
};

motoko/classes/src/map/Buckets.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import Nat "mo:base/Nat";
22
import Map "mo:base/RBTree";
33

4-
actor class Bucket(n : Nat, i : Nat) {
4+
persistent actor class Bucket(n : Nat, i : Nat) {
55

66
type Key = Nat;
77
type Value = Text;
88

9-
let map = Map.RBTree<Key, Value>(Nat.compare);
9+
transient let map = Map.RBTree<Key, Value>(Nat.compare);
1010

1111
public func get(k : Key) : async ?Value {
1212
assert ((k % n) == i);

motoko/classes/src/map/Map.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Array "mo:base/Array";
22
import Cycles "mo:base/ExperimentalCycles";
33
import Buckets "Buckets";
44

5-
actor Map {
5+
persistent actor Map {
66

77
let n = 4; // number of buckets
88

motoko/classes/src/test/Test.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Debug "mo:base/Debug";
22
import Map "canister:map";
33

4-
actor Test {
4+
persistent actor Test {
55

66
public func run() : async () {
77
var i = 0;

motoko/composite_query/src/map/Buckets.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import Nat "mo:base/Nat";
22
import Map "mo:base/RBTree";
33

4-
actor class Bucket(n : Nat, i : Nat) {
4+
persistent actor class Bucket(n : Nat, i : Nat) {
55

66
type Key = Nat;
77
type Value = Text;
88

9-
let map = Map.RBTree<Key, Value>(Nat.compare);
9+
transient let map = Map.RBTree<Key, Value>(Nat.compare);
1010

1111
public query func get(k : Key) : async ?Value {
1212
assert ((k % n) == i);

motoko/composite_query/src/map/Map.mo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Array "mo:base/Array";
33
import Cycles "mo:base/ExperimentalCycles";
44
import Buckets "Buckets";
55

6-
actor Map {
6+
persistent actor Map {
77

88
let n = 4; // number of buckets
99

@@ -49,9 +49,9 @@ actor Map {
4949
public func test() : async () {
5050
var i = 0;
5151
while (i < 16) {
52-
let t = debug_show(i);
52+
let t = debug_show (i);
5353
assert (null == (await getUpdate(i)));
54-
Debug.print("putting: " # debug_show(i, t));
54+
Debug.print("putting: " # debug_show (i, t));
5555
await Map.put(i, t);
5656
assert (?t == (await getUpdate(i)));
5757
i += 1;

0 commit comments

Comments
 (0)