Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI test] test: include instantiate_call_data_works #389

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions crates/pop-cli/src/commands/up/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,18 +483,19 @@ mod tests {
let localhost_url = format!("ws://127.0.0.1:{}", port);
sleep(Duration::from_secs(5)).await;

get_upload_call_data_works(port, temp_dir).await?;
get_upload_call_data_works(port, temp_dir.path().join("testing")).await?;
get_instantiate_call_data_works(port, temp_dir.path().join("testing")).await?;

// Stop running contracts-node
stop_test_environment(&contracts_node_process.id().to_string())?;
Ok(())
}

async fn get_upload_call_data_works(port: u16, temp_dir: TempDir) -> anyhow::Result<()> {
async fn get_upload_call_data_works(port: u16, temp_dir: PathBuf) -> anyhow::Result<()> {
let localhost_url = format!("ws://127.0.0.1:{}", port);

let up_contract_opts = UpContractCommand {
path: Some(temp_dir.path().join("testing")),
path: Some(temp_dir),
constructor: "new".to_string(),
args: vec![],
value: "0".to_string(),
Expand Down Expand Up @@ -541,11 +542,11 @@ mod tests {
Ok(())
}

async fn get_instantiate_call_data_works(port: u16, temp_dir: TempDir) -> anyhow::Result<()> {
async fn get_instantiate_call_data_works(port: u16, temp_dir: PathBuf) -> anyhow::Result<()> {
let localhost_url = format!("ws://127.0.0.1:{}", port);

let up_contract_opts = UpContractCommand {
path: Some(temp_dir.path().join("testing")),
path: Some(temp_dir),
constructor: "new".to_string(),
args: vec!["false".to_string()],
value: "0".to_string(),
Expand Down
4 changes: 2 additions & 2 deletions crates/pop-contracts/src/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ pub async fn run_contracts_node(

let process = command.spawn()?;

// Wait 5 secs until the node is ready
sleep(Duration::from_millis(5000)).await;
// Wait 20 secs until the node is ready
sleep(Duration::from_millis(20000)).await;

let data = Value::from_bytes(subxt::utils::to_hex("initialize contracts node"));
let payload = subxt::dynamic::tx("System", "remark", [data].to_vec());
Expand Down
Loading