Skip to content

Commit

Permalink
These changes should resolve any issues in IDEs also.
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptoquick committed Dec 18, 2023
1 parent ddf4138 commit de7444b
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
RUST_BACKTRACE: 1

- name: RGB Test Init
run: cargo test --locked --features server --test init -- init --nocapture --test-threads 1
run: cargo test --locked --features server --test _init -- _init --nocapture --test-threads 1

- name: RGB Tests
run: cargo test --locked --features server --test rgb -- rgb --nocapture --test-threads 1
Expand Down
35 changes: 5 additions & 30 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ anyhow = "1.0.71"
blake3 = "1.4.1"
rgb-std = { version = "0.10.2" }
serde = "1.0.189"
toml = { version = "0.7.8", features = ["preserve_order"] }
toml = { version = "0.8.0", features = ["preserve_order"] }

[patch.crates-io]
# Remove after merge and release https://github.com/BP-WG/bitcoin_foundation/pull/20
Expand Down
12 changes: 11 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{collections::BTreeMap, fs};
use std::{collections::BTreeMap, env, fs, path};

use anyhow::Result;
use rgbstd::{
Expand Down Expand Up @@ -54,6 +54,14 @@ const MARKETPLACE_OFFERS: &str = "bitmask-marketplace_public_offers.c15";
const MARKETPLACE_BIDS: &str = "bitmask-marketplace_public_bids.c15";
const NETWORK: &str = "bitcoin"; // Only mainnet is tracked, no monetary incentive to upgrade testnet assets

pub fn init_fs() -> Result<()> {
let dir = env::var("CARBONADO_DIR").unwrap_or("/tmp/bitmaskd/carbonado".to_owned());
let dir = path::Path::new(&dir);
fs::create_dir_all(dir)?;

Ok(())
}

fn main() -> Result<()> {
// lib ids
const BMC_VERSION: &str = env!("CARGO_PKG_VERSION");
Expand Down Expand Up @@ -158,5 +166,7 @@ fn main() -> Result<()> {

fs::write(FILE_HASHES_FILE, toml)?;

init_fs()?;

Ok(())
}
7 changes: 3 additions & 4 deletions src/regtest.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#![cfg(not(target_arch = "wasm32"))]
use std::{
env, path,
env, fs, path,
process::{Command, Stdio},
};

use anyhow::Result;
use tokio::fs;

pub async fn init_fs() -> Result<()> {
pub fn init_fs() -> Result<()> {
let dir = env::var("CARBONADO_DIR").unwrap_or("/tmp/bitmaskd/carbonado".to_owned());
let dir = path::Path::new(&dir);
fs::create_dir_all(dir).await?;
fs::create_dir_all(dir)?;

Ok(())
}
Expand Down
6 changes: 3 additions & 3 deletions tests/init.rs → tests/_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
use anyhow::Result;
use bitmask_core::regtest::init_fs;

#[tokio::test]
pub async fn init() -> Result<()> {
init_fs().await?;
#[test]
pub fn _init() -> Result<()> {
init_fs()?;

Ok(())
}

0 comments on commit de7444b

Please sign in to comment.