diff --git a/Cargo.lock b/Cargo.lock index 287ce9af..44258b4b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,6 +67,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base58" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" + [[package]] name = "base64" version = "0.13.1" @@ -75,19 +81,27 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "bitcoinsv" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "097c2286ec4903cf2f2178d9ed880e54c0c70f9611b924899e5965d992172ffa" +checksum = "09792e7e7778ea1f45f5eedbf7805a490f03a8fc5c2d706462f90e89e1922d9d" dependencies = [ "async-trait", + "base58", "byteorder", + "bytes", "futures", "hex", "log", + "minactor", + "num", + "rand", "ring", + "ripemd", + "secp256k1", "serde", "tokio", "tokio-stream", + "tokio-util", "uuid", ] @@ -125,6 +139,15 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + [[package]] name = "byteorder" version = "1.5.0" @@ -133,9 +156,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "cc" @@ -149,6 +172,26 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + [[package]] name = "env_logger" version = "0.10.2" @@ -276,6 +319,16 @@ dependencies = [ "slab", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getrandom" version = "0.2.15" @@ -293,6 +346,12 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + [[package]] name = "hermit-abi" version = "0.3.9" @@ -403,6 +462,18 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "minactor" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41a91cedd462640267aaaf63b9985dc14a8bbd79fd734a39a242ee6a9e40594b" +dependencies = [ + "log", + "tokio", + "tokio-util", + "trait-variant", +] + [[package]] name = "miniz_oxide" version = "0.7.4" @@ -434,6 +505,70 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -610,6 +745,15 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest", +] + [[package]] name = "rustc-demangle" version = "0.1.24" @@ -641,6 +785,25 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "secp256k1" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" +dependencies = [ + "rand", + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" +dependencies = [ + "cc", +] + [[package]] name = "serde" version = "1.0.204" @@ -800,6 +963,38 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-util" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "futures-util", + "hashbrown", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "trait-variant" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70977707304198400eb4835a78f6a9f928bf41bba420deb8fdb175cd965d77a7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + [[package]] name = "unicode-bidi" version = "0.3.15" @@ -860,6 +1055,12 @@ dependencies = [ "syn", ] +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/client/Cargo.toml b/client/Cargo.toml index 04ae3248..ac477591 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -24,7 +24,7 @@ jsonrpc = { version = "0.16.0", features = ["minreq_http"]} serde = "1" serde_json = "1" hex = "0.4.3" -bitcoinsv = "0.2.5" +bitcoinsv = "0.2.7" async-trait = "0.1.75" url = "2.5.0" diff --git a/client/src/error.rs b/client/src/error.rs index e4c98b3a..26310ba6 100644 --- a/client/src/error.rs +++ b/client/src/error.rs @@ -18,7 +18,7 @@ pub enum Error { /// The URI could not be parsed. InvalidUri, MinReqError(jsonrpc::minreq_http::Error), - SVJsonError(bitcoinsv::Error), + SVJsonError(bitcoinsv::BsvError), } impl From for Error { @@ -51,8 +51,8 @@ impl From for Error { } } -impl From for Error { - fn from(e: bitcoinsv::Error) -> Error { +impl From for Error { + fn from(e: bitcoinsv::BsvError) -> Error { Error::SVJsonError(e) } } diff --git a/integration_test/Cargo.toml b/integration_test/Cargo.toml index 95872e0d..6de1569b 100644 --- a/integration_test/Cargo.toml +++ b/integration_test/Cargo.toml @@ -11,4 +11,4 @@ log = "0.4" env_logger = "0.10.1" tokio = { version = "1", features = ["full"] } tokio-stream = "0.1" -bitcoinsv = "0.2.4" +bitcoinsv = "0.2.7" diff --git a/json/Cargo.toml b/json/Cargo.toml index 0e4c929b..bc9a6f4a 100644 --- a/json/Cargo.toml +++ b/json/Cargo.toml @@ -20,7 +20,7 @@ path = "src/lib.rs" hex = "0.4.3" serde = { version = "1", features = [ "derive" ] } serde_json = "1" -bitcoinsv = "0.2.5" +bitcoinsv = "0.2.7" [dev-dependencies] approx = "0.5" diff --git a/json/src/lib.rs b/json/src/lib.rs index 585506e9..ec5027a0 100644 --- a/json/src/lib.rs +++ b/json/src/lib.rs @@ -646,7 +646,7 @@ impl GetRawTransactionResult { self.vin.len() == 1 && self.vin[0].is_coinbase() } - pub fn transaction(&self) -> Result { + pub fn transaction(&self) -> Result { let tx = Tx::from_hex(&self.hex)?; Ok(tx) }