Skip to content

Commit

Permalink
Merge branch 'HB/rbf-tmp' into HB/rbf
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptoquick committed Dec 21, 2023
2 parents 1bf71e5 + 22981bb commit 4ed58a9
Show file tree
Hide file tree
Showing 38 changed files with 3,650 additions and 612 deletions.
4 changes: 3 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ CARBONADO_ENDPOINT=http://localhost:7070/carbonado
UDAS_UTXO=3b367e1facc3174e97658295961faf6a4ed889129c881b7a73db1f074b49bd8a:
MARKETPLACE_SEED="lion bronze dumb tuna perfect fantasy wall orphan improve business harbor sadness"
MARKETPLACE_NOSTR=cd591c134a0d88991326b1619953d0eae2287d315a7c4a93c1e4883a8c26c464

# 1..100
MARKETPLACE_FEE_PERC=
# xpub..
MARKETPLACE_FEE_XPUB=

# :: Coordinator ::
COORDINATOR_NOSTR=9e8294eb38ba77c0fba982da8fbd370b8868c6dbfc9ca414aff4863c15dfbcff

# :: RGB PROXY ::
RGB_PROXY_ENDPOINT=http://localhost:3001
5 changes: 4 additions & 1 deletion .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,11 @@ jobs:
MAIN_VAULT_ADDRESS: ${{ secrets.MAIN_VAULT_ADDRESS }}
RUST_BACKTRACE: 1

- name: RGB Test Init
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
run: cargo test --locked --features server --test rgb -- rgb --nocapture --test-threads 1
env:
TEST_WALLET_SEED: ${{ secrets.TEST_WALLET_SEED }}
RUST_BACKTRACE: 1
Expand Down
136 changes: 101 additions & 35 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ esplora_block = { version = "0.5.0", package = "esplora-client", default-feature
"blocking",
] }
inflate = "0.4.5"
sled = "0.34.7"
tower-http = { version = "0.4.4", features = ["cors"], optional = true }

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
Expand All @@ -134,7 +135,8 @@ 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"] }
serde_json = "1.0.107"
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
28 changes: 27 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,30 @@ 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

#[derive(Serialize, Deserialize, Default)]
pub struct MetricsData {
bytes: u64,
bytes_by_day: BTreeMap<String, u64>,
bitcoin_wallets_by_day: BTreeMap<String, usize>,
signet_wallets_by_day: BTreeMap<String, usize>,
testnet_wallets_by_day: BTreeMap<String, usize>,
regtest_wallets_by_day: BTreeMap<String, usize>,
wallets_by_network: BTreeMap<String, usize>,
}

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)?;
fs::write(
dir.join("metrics.json"),
serde_json::to_string_pretty(&MetricsData::default())?,
)?;

Ok(())
}

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

fs::write(FILE_HASHES_FILE, toml)?;

init_fs()?;

Ok(())
}
6 changes: 6 additions & 0 deletions lib/web/bitcoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ export interface TransactionDetails extends Transaction {
}

export interface TransactionData {
details: TransactionDataDetails;
vsize: number;
feeRate: number;
}

export interface TransactionDataDetails {
transaction?: Transaction;
txid: string;
received: number;
Expand Down
4 changes: 2 additions & 2 deletions lib/web/package-lock.json

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

2 changes: 1 addition & 1 deletion lib/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"Francisco Calderón <[email protected]>"
],
"description": "Core functionality for the BitMask wallet",
"version": "0.7.0-beta.8",
"version": "0.7.0-beta.10",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit 4ed58a9

Please sign in to comment.