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

Owen/bitseed/bitcoin move test #1583

Merged
merged 3 commits into from
Apr 17, 2024
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
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.

1 change: 1 addition & 0 deletions crates/rooch-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
rand = { workspace = true }
anyhow = { workspace = true }
serde = { workspace = true }
serde_yaml = { workspace = true }
Expand Down
8 changes: 7 additions & 1 deletion crates/rooch-config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// Copyright (c) RoochNetwork
// SPDX-License-Identifier: Apache-2.0

use std::env;
use std::fs::create_dir_all;
use std::sync::Arc;
use std::{fmt::Debug, path::Path, path::PathBuf};

use anyhow::Result;
use clap::Parser;
use once_cell::sync::Lazy;
use rand::Rng;
use serde::{Deserialize, Serialize};

use moveos_config::{temp_dir, DataDirPath};
Expand Down Expand Up @@ -158,8 +160,12 @@ impl std::fmt::Display for RoochOpt {

impl RoochOpt {
pub fn new_with_temp_store() -> Self {
let temp_dir = env::temp_dir();
let random_dir_name = format!("random_dir_{}", rand::thread_rng().gen::<u32>());
let random_dir = temp_dir.join(random_dir_name);

RoochOpt {
base_data_dir: Some(PathBuf::from("TMP")),
base_data_dir: Some(random_dir),
chain_id: Some(RoochChainID::LOCAL),
store: StoreConfig::default(),
port: None,
Expand Down
4 changes: 2 additions & 2 deletions crates/testsuite/features/cmd.feature
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ Feature: Rooch CLI integration tests
Then assert: "{{$.wallet[-1].total}} == 5000000000"

# query utxos and inscriptions
#Then cmd: "rpc request --method rooch_queryGlobalStates --params '[{"object_type":"0x4::utxo::UTXO"}, null, "2", true]'"
#Then cmd: "rpc request --method rooch_queryGlobalStates --params '[{"object_type":"0x4::ord::Inscription"}, null, "2", true]'"
Then cmd: "rpc request --method rooch_queryGlobalStates --params '[{"object_type":"0x4::utxo::UTXO"}, null, "2", true]'"
Then cmd: "rpc request --method rooch_queryGlobalStates --params '[{"object_type":"0x4::ord::Inscription"}, null, "2", true]'"

# release servers
Then stop the server
Expand Down
2 changes: 1 addition & 1 deletion crates/testsuite/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async fn start_server(w: &mut World, _scenario: String) {
opt.btc_rpc_username = Some(RPC_USER.to_string());
opt.btc_rpc_password = Some(RPC_PASS.to_string());
opt.btc_start_block_height = Some(0);
opt.data_import_mode = Some(1); // Enable data import without writing indexes
opt.data_import_mode = Some(0); // Enable data import without writing indexes
info!("config btc rpc ok");

w.bitcoind = Some(bitcoind);
Expand Down
2 changes: 1 addition & 1 deletion scripts/bitcoin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Copyright (c) RoochNetwork
# SPDX-License-Identifier: Apache-2.0

cargo test -p testsuite --test integration -- --name "rooch bitcoin test"
RUST_LOG=debug cargo test -p testsuite --test integration -- --name "rooch bitcoin test"
Loading