diff --git a/Cargo.lock b/Cargo.lock index d41078a..2882025 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -329,8 +329,7 @@ dependencies = [ [[package]] name = "bp-consensus" version = "0.11.0-beta.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3a99a46063d23d20a3177a04923652b245f31c2a04a6d0c47d5a93dc201a80" +source = "git+https://github.com/BP-WG/bp-core?branch=develop#6ae56d5a005f0e0fc761516fb96c2c47bb13de46" dependencies = [ "amplify", "chrono", @@ -344,8 +343,7 @@ dependencies = [ [[package]] name = "bp-core" version = "0.11.0-beta.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b8caf04291e2703ce267b1f8baf14f03879a6d1a5afe76e011ada489f172f9" +source = "git+https://github.com/BP-WG/bp-core?branch=develop#6ae56d5a005f0e0fc761516fb96c2c47bb13de46" dependencies = [ "amplify", "bp-consensus", @@ -363,8 +361,7 @@ dependencies = [ [[package]] name = "bp-dbc" version = "0.11.0-beta.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11fc4081db2147411381b9650765ce683e5065559f1125508696f79cc4cbfedf" +source = "git+https://github.com/BP-WG/bp-core?branch=develop#6ae56d5a005f0e0fc761516fb96c2c47bb13de46" dependencies = [ "amplify", "base85", @@ -378,8 +375,7 @@ dependencies = [ [[package]] name = "bp-derive" version = "0.11.0-beta.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2687829a365ba79a22d91737fa7404fd3e2aaeee6b8f5780fa3e94e6cb36c2" +source = "git+https://github.com/BP-WG/bp-std?branch=develop#eb393cdb1c234cb76c100cea67b87c0cbc85fab8" dependencies = [ "amplify", "bp-consensus", @@ -427,8 +423,7 @@ dependencies = [ [[package]] name = "bp-invoice" version = "0.11.0-beta.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29c4f672b4b82ce7a218b2900254ac8e4b15b0022ed13abffa722571e73d375" +source = "git+https://github.com/BP-WG/bp-std?branch=develop#eb393cdb1c234cb76c100cea67b87c0cbc85fab8" dependencies = [ "amplify", "bech32", @@ -440,8 +435,7 @@ dependencies = [ [[package]] name = "bp-seals" version = "0.11.0-beta.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d607238c2bf2c34d048d14cd798a6365306e0fb6b02211235f3ccad0bc7fa8f1" +source = "git+https://github.com/BP-WG/bp-core?branch=develop#6ae56d5a005f0e0fc761516fb96c2c47bb13de46" dependencies = [ "amplify", "baid64", @@ -457,8 +451,7 @@ dependencies = [ [[package]] name = "bp-std" version = "0.11.0-beta.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c9642f7b303791ba5696ff4be52c8d21ac2d2265bf9552692c8b03c741c11c" +source = "git+https://github.com/BP-WG/bp-std?branch=develop#eb393cdb1c234cb76c100cea67b87c0cbc85fab8" dependencies = [ "amplify", "bp-consensus", @@ -761,8 +754,7 @@ dependencies = [ [[package]] name = "descriptors" version = "0.11.0-beta.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e15b0f1ea4c1b7f66b86153341f08961122f5bad3fa68546b9ac5b199c99c39" +source = "git+https://github.com/BP-WG/bp-std?branch=develop#eb393cdb1c234cb76c100cea67b87c0cbc85fab8" dependencies = [ "amplify", "bp-derive", @@ -1290,8 +1282,7 @@ dependencies = [ [[package]] name = "psbt" version = "0.11.0-beta.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b5b2f8fb596a1caffa486595c66eae3ebc3fb05c74063348b9a987373ba0cdb" +source = "git+https://github.com/BP-WG/bp-std?branch=develop#eb393cdb1c234cb76c100cea67b87c0cbc85fab8" dependencies = [ "amplify", "base64", @@ -1387,7 +1378,7 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rgb-core" version = "0.11.0-beta.8" -source = "git+https://github.com/RGB-WG/rgb-core?branch=fix/273#e2a451fa793fe5403b4114b5ed5e9e47c69674cd" +source = "git+https://github.com/RGB-WG/rgb-core?branch=develop#0450760dbae554de0d7623691aed7630f1b60a60" dependencies = [ "aluvm", "amplify", @@ -1408,7 +1399,7 @@ dependencies = [ [[package]] name = "rgb-invoice" version = "0.11.0-beta.8" -source = "git+https://github.com/RGB-WG/rgb-std?branch=fix/rgb-252#94b5ebc6b998b4aa2321513c08b4ff2aebfd2a56" +source = "git+https://github.com/RGB-WG/rgb-std?branch=develop#796312c89122607ff77dd41c5cffeb34db472d34" dependencies = [ "amplify", "baid64", @@ -1474,7 +1465,7 @@ dependencies = [ [[package]] name = "rgb-std" version = "0.11.0-beta.8" -source = "git+https://github.com/RGB-WG/rgb-std?branch=fix/rgb-252#94b5ebc6b998b4aa2321513c08b4ff2aebfd2a56" +source = "git+https://github.com/RGB-WG/rgb-std?branch=develop#796312c89122607ff77dd41c5cffeb34db472d34" dependencies = [ "aluvm", "amplify", diff --git a/Cargo.toml b/Cargo.toml index d8115c1..758b950 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -104,7 +104,17 @@ serde = ["serde_crate", "serde_yaml", "bp-std/serde", "descriptors/serde", "rgb- features = ["all"] [patch.crates-io] -bp-wallet = { git = "https://github.com/BP-WG/bp-wallet", branch = "develop" } +bp-consensus = { git = "https://github.com/BP-WG/bp-core", branch = "develop" } +bp-dbc = { git = "https://github.com/BP-WG/bp-core", branch = "develop" } +bp-seals = { git = "https://github.com/BP-WG/bp-core", branch = "develop" } +bp-core = { git = "https://github.com/BP-WG/bp-core", branch = "develop" } +bp-invoice = { git = "https://github.com/BP-WG/bp-std", branch = "develop" } +bp-derive = { git = "https://github.com/BP-WG/bp-std", branch = "develop" } +descriptors = { git = "https://github.com/BP-WG/bp-std", branch = "develop" } +psbt = { git = "https://github.com/BP-WG/bp-std", branch = "develop" } +bp-std = { git = "https://github.com/BP-WG/bp-std", branch = "develop" } bp-esplora = { git = "https://github.com/BP-WG/bp-esplora-client", branch = "master" } -rgb-core = { git = "https://github.com/RGB-WG/rgb-core", branch = "fix/273" } -rgb-std = { git = "https://github.com/RGB-WG/rgb-std", branch = "fix/rgb-252" } +bp-wallet = { git = "https://github.com/BP-WG/bp-wallet", branch = "develop" } +rgb-core = { git = "https://github.com/RGB-WG/rgb-core", branch = "develop" } +rgb-invoice = { git = "https://github.com/RGB-WG/rgb-std", branch = "develop" } +rgb-std = { git = "https://github.com/RGB-WG/rgb-std", branch = "develop" } diff --git a/src/indexers/electrum_blocking.rs b/src/indexers/electrum_blocking.rs index 7c2b30c..294f15c 100644 --- a/src/indexers/electrum_blocking.rs +++ b/src/indexers/electrum_blocking.rs @@ -22,6 +22,7 @@ // limitations under the License. use std::iter; +use std::num::NonZeroU32; use bp::ConsensusDecode; use bpstd::{Network, Tx, Txid}; @@ -124,8 +125,10 @@ impl RgbResolver for Client { let tx_height = u32::try_from(get_merkle_res.block_height) .map_err(|_| s!("impossible height value"))?; + let height = + check!(NonZeroU32::new(tx_height).ok_or(Error::InvalidResponse(tx_details.clone()))); let pos = check!( - WitnessPos::new(tx_height, block_time) + WitnessPos::bitcoin(height, block_time) .ok_or(Error::InvalidResponse(tx_details.clone())) ); diff --git a/src/indexers/esplora_blocking.rs b/src/indexers/esplora_blocking.rs index 324528a..e72e2fa 100644 --- a/src/indexers/esplora_blocking.rs +++ b/src/indexers/esplora_blocking.rs @@ -19,6 +19,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +use std::num::NonZeroU32; + use bp::Tx; use bpstd::{Network, Txid}; use esplora::BlockingClient; @@ -48,7 +50,10 @@ impl RgbResolver for BlockingClient { .and_then(|h| status.block_time.map(|t| (h, t))) { Some((h, t)) => { - WitnessOrd::Mined(WitnessPos::new(h, t as i64).ok_or(Error::InvalidServerData)?) + let height = NonZeroU32::new(h).ok_or(Error::InvalidServerData)?; + WitnessOrd::Mined( + WitnessPos::bitcoin(height, t as i64).ok_or(Error::InvalidServerData)?, + ) } None => WitnessOrd::Tentative, };