Skip to content

Commit

Permalink
Fix testsuite (#3260)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanlee42 authored Mar 4, 2022
1 parent 93c9a9f commit cd81149
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 23 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 23 additions & 22 deletions testsuite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,31 @@ anyhow = "1.0.41"
lazy_static = "1.4.0"
serde = { version = "1.0.130", features = ["derive"] }
serde_bytes = "0.11"
serde_json = { version="1.0", features = ["arbitrary_precision"]}
serde_json = { version = "1.0", features = ["arbitrary_precision"] }
clap = "2.33.3"
structopt = "0.3.26"
regex = "1.5.4"
starcoin-config = {path = "../config"}
starcoin-consensus = {path = "../consensus"}
starcoin-executor = {path = "../executor"}
starcoin-network = {path = "../network"}
starcoin-txpool = {path = "../txpool"}
starcoin-chain = {path = "../chain"}
starcoin-rpc-server = {path = "../rpc/server"}
starcoin-rpc-client = { path = "../rpc/client"}
starcoin-storage = {path = "../storage"}
starcoin-miner = {path = "../miner"}
starcoin-node = {path = "../node"}
starcoin-crypto = { git = "https://github.com/starcoinorg/starcoin-crypto", rev = "78aaf55a8b85a5eff208037e0cc798cf985e1a4e"}
starcoin-logger = {path = "../commons/logger"}
starcoin-cmd = {package = "starcoin-cmd", path= "../cmd/starcoin"}
scmd = {path = "../commons/scmd"}
starcoin-types = {path = "../types"}
starcoin-vm-runtime = {path = "../vm/vm-runtime"}
starcoin-vm-types = {path = "../vm/types"}
starcoin-account-api= {path ="../account/api"}
starcoin-state-api = {path = "../state/api"}
starcoin-config = { path = "../config" }
starcoin-consensus = { path = "../consensus" }
starcoin-executor = { path = "../executor" }
starcoin-network = { path = "../network" }
starcoin-txpool = { path = "../txpool" }
starcoin-chain = { path = "../chain" }
starcoin-rpc-server = { path = "../rpc/server" }
starcoin-rpc-client = { path = "../rpc/client" }
starcoin-storage = { path = "../storage" }
starcoin-miner = { path = "../miner" }
starcoin-node = { path = "../node" }
starcoin-crypto = { git = "https://github.com/starcoinorg/starcoin-crypto", rev = "78aaf55a8b85a5eff208037e0cc798cf985e1a4e" }
starcoin-logger = { path = "../commons/logger" }
starcoin-cmd = { package = "starcoin-cmd", path = "../cmd/starcoin" }
scmd = { path = "../commons/scmd" }
starcoin-types = { path = "../types" }
starcoin-vm-runtime = { path = "../vm/vm-runtime" }
starcoin-vm-types = { path = "../vm/types" }
starcoin-account-api = { path = "../account/api" }
starcoin-state-api = { path = "../state/api" }
starcoin-account-provider = { path = "../account/provider" }
cucumber = { package = "cucumber_rust", version = "^0.6.0" }
jsonpath = "0.1.1"

Expand All @@ -43,6 +44,6 @@ jsonpath = "0.1.1"


[[test]]
test =false
test = false
name = "integration"
harness = false
11 changes: 10 additions & 1 deletion testsuite/tests/steps/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ use lazy_static::lazy_static;
use regex::Regex;
use scmd::CmdContext;
use serde_json::Value;
use starcoin_account_provider::ProviderFactory;
use starcoin_cmd::add_command;
use starcoin_cmd::{CliState, StarcoinOpt};
use starcoin_config::account_provider_config::AccountProviderConfig;
use starcoin_config::{APP_VERSION, CRATE_VERSION};
use starcoin_logger::prelude::*;
use std::collections::{HashMap, HashSet};
Expand All @@ -30,13 +32,20 @@ pub fn steps() -> Steps<MyWorld> {
builder
.then_regex(r#"cmd: "([^"]*)""#, |world: &mut MyWorld, args, _step| {
let client = world.default_rpc_client.as_ref().take().unwrap();

let chain_id = client.node_info().unwrap().net.chain_id();
let account_client = ProviderFactory::create_provider(
client.clone(),
chain_id,
&AccountProviderConfig::default(),
)
.unwrap();
let node_info = client.clone().node_info().unwrap();
let state = CliState::new(
node_info.net,
client.clone(),
Some(Duration::from_secs(5)),
None,
account_client,
);
let context = CmdContext::<CliState, StarcoinOpt>::with_state(
CRATE_VERSION,
Expand Down

0 comments on commit cd81149

Please sign in to comment.