Skip to content

Commit 2e693e1

Browse files
authored
Merge pull request #203 from dfinity/mathias-FI-1858-migrate-state-machine-to-pocket-ic
feat: FI-1858: Migrate from StateMachine to PocketIC
2 parents 7adb16c + 56e7cdf commit 2e693e1

28 files changed

+9608
-4042
lines changed

Cargo.Bazel.lock

Lines changed: 8481 additions & 3695 deletions
Large diffs are not rendered by default.

Cargo.lock

Lines changed: 934 additions & 125 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[workspace]
22

33
members = [
4-
"test/env",
5-
"test/env/state-machine",
6-
"test/env/replica",
7-
"test/suite",
8-
"test/runner",
9-
"test/replica",
4+
"test/env",
5+
"test/env/pocket-ic",
6+
"test/env/replica",
7+
"test/suite",
8+
"test/runner",
9+
"test/replica",
1010
]
1111

1212
[workspace.dependencies]
@@ -16,7 +16,7 @@ candid = "0.10.0"
1616
hex = "0.4.3"
1717
ic-agent = "0.31.0"
1818
reqwest = "0.11"
19-
ic-test-state-machine-client = "3.0.0"
19+
pocket-ic = "9.0.2"
2020
rand = "0.8.5"
2121
serde = "^1.0.184"
2222
tempfile = "3.3"

WORKSPACE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ crates_repository(
8686
"//:Cargo.toml",
8787
"//test/env:Cargo.toml",
8888
"//test/env/replica:Cargo.toml",
89-
"//test/env/state-machine:Cargo.toml",
89+
"//test/env/pocket-ic:Cargo.toml",
9090
"//test/suite:Cargo.toml",
9191
"//test/runner:Cargo.toml",
9292
"//test/replica:Cargo.toml",

bazel/replica_tools.bzl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
REPLICA_BUILD = """
22
package(default_visibility = ["//visibility:public"])
33
4-
exports_files(["replica", "ic-starter", "canister_sandbox", "sandbox_launcher","ic-test-state-machine"])
4+
exports_files(["replica", "ic-starter", "canister_sandbox", "sandbox_launcher"])
55
"""
66

77
IC_COMMIT_HASH = "09c3000df0a54c470994ceb5bc33bd8457b02fe7"
@@ -23,10 +23,6 @@ BINARY_HASHES = {
2323
"linux": "96c416bf98724aa3bf72053d06d559f007f8655261b48f435f9104b605c8f77f",
2424
"mac os x": "ed0bc2eeaf282012c8475ddf1ca3369488dc80d385e5b194d2823ae84514ff8a",
2525
},
26-
"ic-test-state-machine.gz": {
27-
"linux": "2fb622770cfdf815f74f0e2fbaa51795c74ecba334883a4762507aef90352c15",
28-
"mac os x": "c8c7a6daa921b243cb6f1825dd7f80a7a7543234476d50f7becda072b1725c5c",
29-
},
3026
}
3127

3228
def _replica_impl(repository_ctx):

test/env/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "icrc1-test-env"
3-
version = "0.1.12"
3+
version = "0.2.0"
44
authors = { workspace = true }
55
edition = { workspace = true }
66
license = { workspace = true }
@@ -13,7 +13,7 @@ path = "lib.rs"
1313

1414
[dependencies]
1515
anyhow = { workspace = true }
16-
async-trait = { workspace = true }
16+
async-trait = { workspace = true }
1717
candid = { workspace = true }
1818
serde = { workspace = true }
1919
thiserror = { workspace = true }

test/env/Changelog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [0.1.12] - 2025-09-08
7+
## [0.2.0] - 2025-09-09
88
### Changed
9-
- Bump rust to 1.85.0
9+
- Migrated from StateMachine to PocketIC
1010

1111
## [0.1.11] - 2024-01-16
1212
### Added

test/env/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ pub trait LedgerEnv {
266266
fn principal(&self) -> Principal;
267267

268268
/// Returns the approximation of the current ledger time.
269-
fn time(&self) -> std::time::SystemTime;
269+
async fn time(&self) -> std::time::SystemTime;
270270

271271
/// Executes a query call with the specified arguments on the ledger.
272272
async fn query<Input, Output>(&self, method: &str, input: Input) -> anyhow::Result<Output>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ MACRO_DEPENDENCIES = [
1010
]
1111

1212
rust_library(
13-
name = "state-machine",
13+
name = "pocket-ic",
1414
srcs = ["lib.rs"],
15-
crate_name = "icrc1_test_env_state_machine",
15+
crate_name = "icrc1_test_env_pocket_ic",
1616
deps = all_crate_deps(
1717
normal = True,
1818
) + [ "//test/env",
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
2-
name = "icrc1-test-env-state-machine"
3-
version = "0.1.12"
2+
name = "icrc1-test-env-pocket-ic"
3+
version = "0.2.0"
44
authors = { workspace = true }
55
edition = { workspace = true }
66
license = { workspace = true }
77
rust-version = { workspace = true }
88
repository = { workspace = true }
9-
description = "DEPRECATED: Use icrc1-test-env-pocket-ic"
9+
description = { workspace = true }
1010

1111
[lib]
1212
path = "lib.rs"
@@ -16,5 +16,5 @@ anyhow = { workspace = true }
1616
candid = { workspace = true }
1717
async-trait = { workspace = true }
1818
hex = { workspace = true }
19-
ic-test-state-machine-client = { workspace = true }
20-
icrc1-test-env = { version = "0.1.12", path = ".." }
19+
pocket-ic = { workspace = true }
20+
icrc1-test-env = { version = "0.2.0", path = ".." }

0 commit comments

Comments
 (0)