-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
77 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |
This file was deleted.
Oops, something went wrong.