Skip to content

Commit

Permalink
non-running integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexytsu committed Jul 11, 2022
1 parent 950d95d commit cbeccf8
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
members = [
"fvm_dispatch",
"fil_token",
"testing/integration",
"testing/integration/actors/wfil_token_actor",
"testing/fil_token_integration",
"testing/fil_token_integration/actors/wfil_token_actor",
]
5 changes: 2 additions & 3 deletions fil_token/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ edition = "2021"
[dependencies]
anyhow = "1.0.56"
cid = { version = "0.8.3", default-features = false, features = ["serde-codec"] }
fvm_dispatch = { version = "0.1.0", path = "../fvm_dispatch" }
fvm_ipld_blockstore = "0.1.1"
fvm_ipld_hamt = "0.5.1"
fvm_ipld_amt = { version = "0.4.2", features = ["go-interop"] }
fvm_ipld_encoding = "0.2.2"
fvm_sdk = { version = "1.0.0" }
fvm_shared = { version = "0.8.0" }
fvm_sdk = { version = "2.0.0-alpha.1", git = "https://github.com/filecoin-project/ref-fvm" }
fvm_shared = { version = "0.8.0", git = "https://github.com/filecoin-project/ref-fvm" }
serde = { version = "1.0.136", features = ["derive"] }
serde_tuple = { version = "0.5.0" }
11 changes: 11 additions & 0 deletions testing/fil_token_integration/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "fil_token_integration_tests"
version = "0.1.0"
repository = "https://github.com/helix-collective/filecoin"
edition = "2021"

[dependencies]
fil_token = { version = "0.1.0", path = "../../fil_token" }
fvm_integration_tests = { version = "0.1.0", git = "https://github.com/filecoin-project/ref-fvm" }
fvm_ipld_blockstore = { version = "0.1.1", git = "https://github.com/filecoin-project/ref-fvm" }
fvm_shared = { version = "0.8.0", git = "https://github.com/filecoin-project/ref-fvm" }
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ edition = "2021"
[dependencies]
anyhow = { version = "1.0.56" }
fvm_ipld_encoding = { version = "0.2.2" }
fvm_sdk = { version = "1.0.0 "}
fvm_shared = { version = "0.8.0" }
fvm_sdk = { version = "2.0.0-alpha.1", git = "https://github.com/filecoin-project/ref-fvm" }
fvm_shared = { version = "0.8.0", git = "https://github.com/filecoin-project/ref-fvm" }
fil_token = { version = "0.1.0", path = "../../../../fil_token" }

[build-dependencies]
Expand Down
File renamed without changes.
60 changes: 60 additions & 0 deletions testing/fil_token_integration/tests/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
use std::env;

use fil_token::blockstore::Blockstore as ActorBlockstore;
use fil_token::token::state::TokenState;
use fvm_integration_tests::tester::{Account, Tester};
use fvm_ipld_blockstore::MemoryBlockstore;
use fvm_shared::address::Address;
use fvm_shared::bigint::Zero;
use fvm_shared::econ::TokenAmount;
use fvm_shared::message::Message;
use fvm_shared::state::StateTreeVersion;
use fvm_shared::version::NetworkVersion;

const WFIL_TOKEN_WASM_COMPILED_PATH: &str =
"../../target/debug/wbuild/wfil_token_actor/wfil_token_actor.compact.wasm";

#[test]
fn mint_tokens() {
let mut tester = Tester::new(
NetworkVersion::V15,
StateTreeVersion::V4,
MemoryBlockstore::default(),
)
.unwrap();

let minter: [Account; 1] = tester.create_accounts().unwrap();

// Get wasm bin
let wasm_path = env::current_dir()
.unwrap()
.join(WFIL_TOKEN_WASM_COMPILED_PATH)
.canonicalize()
.unwrap();
let wasm_bin = std::fs::read(wasm_path).expect("Unable to read file");

let actor_blockstore = ActorBlockstore::default();
let actor_state = TokenState::new(&actor_blockstore, "Wrapped FIL", "WFIL").unwrap();
let state_cid = tester.set_state(&actor_state).unwrap();

// let actor_address = Address::new_id(10000);
// tester.set_actor_from_bin(&wasm_bin, state_cid, actor_address, TokenAmount::zero());

// // Instantiate machine
// tester.instantiate_machine().unwrap();

// let message = Message {
// from: minter[0].1,
// to: actor_address,
// gas_limit: 10000000,
// method_num: 12, // 12 is Mint function
// value: TokenAmount::from(150),
// ..Message::default()
// };

// let res = tester
// .executor
// .unwrap()
// .execute_message(message, ApplyKind::Explicit, 100)
// .unwrap();
}
4 changes: 0 additions & 4 deletions testing/integration/Cargo.toml

This file was deleted.

0 comments on commit cbeccf8

Please sign in to comment.