Skip to content

Commit cbeccf8

Browse files
committed
non-running integration tests
1 parent 950d95d commit cbeccf8

File tree

10 files changed

+77
-11
lines changed

10 files changed

+77
-11
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
members = [
44
"fvm_dispatch",
55
"fil_token",
6-
"testing/integration",
7-
"testing/integration/actors/wfil_token_actor",
6+
"testing/fil_token_integration",
7+
"testing/fil_token_integration/actors/wfil_token_actor",
88
]

fil_token/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ edition = "2021"
66
[dependencies]
77
anyhow = "1.0.56"
88
cid = { version = "0.8.3", default-features = false, features = ["serde-codec"] }
9-
fvm_dispatch = { version = "0.1.0", path = "../fvm_dispatch" }
109
fvm_ipld_blockstore = "0.1.1"
1110
fvm_ipld_hamt = "0.5.1"
1211
fvm_ipld_amt = { version = "0.4.2", features = ["go-interop"] }
1312
fvm_ipld_encoding = "0.2.2"
14-
fvm_sdk = { version = "1.0.0" }
15-
fvm_shared = { version = "0.8.0" }
13+
fvm_sdk = { version = "2.0.0-alpha.1", git = "https://github.com/filecoin-project/ref-fvm" }
14+
fvm_shared = { version = "0.8.0", git = "https://github.com/filecoin-project/ref-fvm" }
1615
serde = { version = "1.0.136", features = ["derive"] }
1716
serde_tuple = { version = "0.5.0" }
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[package]
2+
name = "fil_token_integration_tests"
3+
version = "0.1.0"
4+
repository = "https://github.com/helix-collective/filecoin"
5+
edition = "2021"
6+
7+
[dependencies]
8+
fil_token = { version = "0.1.0", path = "../../fil_token" }
9+
fvm_integration_tests = { version = "0.1.0", git = "https://github.com/filecoin-project/ref-fvm" }
10+
fvm_ipld_blockstore = { version = "0.1.1", git = "https://github.com/filecoin-project/ref-fvm" }
11+
fvm_shared = { version = "0.8.0", git = "https://github.com/filecoin-project/ref-fvm" }

testing/integration/actors/wfil_token_actor/Cargo.toml renamed to testing/fil_token_integration/actors/wfil_token_actor/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ edition = "2021"
77
[dependencies]
88
anyhow = { version = "1.0.56" }
99
fvm_ipld_encoding = { version = "0.2.2" }
10-
fvm_sdk = { version = "1.0.0 "}
11-
fvm_shared = { version = "0.8.0" }
10+
fvm_sdk = { version = "2.0.0-alpha.1", git = "https://github.com/filecoin-project/ref-fvm" }
11+
fvm_shared = { version = "0.8.0", git = "https://github.com/filecoin-project/ref-fvm" }
1212
fil_token = { version = "0.1.0", path = "../../../../fil_token" }
1313

1414
[build-dependencies]
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
use std::env;
2+
3+
use fil_token::blockstore::Blockstore as ActorBlockstore;
4+
use fil_token::token::state::TokenState;
5+
use fvm_integration_tests::tester::{Account, Tester};
6+
use fvm_ipld_blockstore::MemoryBlockstore;
7+
use fvm_shared::address::Address;
8+
use fvm_shared::bigint::Zero;
9+
use fvm_shared::econ::TokenAmount;
10+
use fvm_shared::message::Message;
11+
use fvm_shared::state::StateTreeVersion;
12+
use fvm_shared::version::NetworkVersion;
13+
14+
const WFIL_TOKEN_WASM_COMPILED_PATH: &str =
15+
"../../target/debug/wbuild/wfil_token_actor/wfil_token_actor.compact.wasm";
16+
17+
#[test]
18+
fn mint_tokens() {
19+
let mut tester = Tester::new(
20+
NetworkVersion::V15,
21+
StateTreeVersion::V4,
22+
MemoryBlockstore::default(),
23+
)
24+
.unwrap();
25+
26+
let minter: [Account; 1] = tester.create_accounts().unwrap();
27+
28+
// Get wasm bin
29+
let wasm_path = env::current_dir()
30+
.unwrap()
31+
.join(WFIL_TOKEN_WASM_COMPILED_PATH)
32+
.canonicalize()
33+
.unwrap();
34+
let wasm_bin = std::fs::read(wasm_path).expect("Unable to read file");
35+
36+
let actor_blockstore = ActorBlockstore::default();
37+
let actor_state = TokenState::new(&actor_blockstore, "Wrapped FIL", "WFIL").unwrap();
38+
let state_cid = tester.set_state(&actor_state).unwrap();
39+
40+
// let actor_address = Address::new_id(10000);
41+
// tester.set_actor_from_bin(&wasm_bin, state_cid, actor_address, TokenAmount::zero());
42+
43+
// // Instantiate machine
44+
// tester.instantiate_machine().unwrap();
45+
46+
// let message = Message {
47+
// from: minter[0].1,
48+
// to: actor_address,
49+
// gas_limit: 10000000,
50+
// method_num: 12, // 12 is Mint function
51+
// value: TokenAmount::from(150),
52+
// ..Message::default()
53+
// };
54+
55+
// let res = tester
56+
// .executor
57+
// .unwrap()
58+
// .execute_message(message, ApplyKind::Explicit, 100)
59+
// .unwrap();
60+
}

testing/integration/Cargo.toml

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)