Skip to content

Commit 1b0f780

Browse files
chore: updated packages and change to rust edition 2024 (#68)
* updated packages * updated to latest rust edition 2024
1 parent 91c5daf commit 1b0f780

File tree

126 files changed

+513
-875
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+513
-875
lines changed

.github/workflows/fuzz.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212
fuzz:
1313
if: ${{ !github.event.act }}
14-
runs-on: ubuntu-20.04
14+
runs-on: ubuntu-latest
1515
strategy:
1616
fail-fast: false
1717
matrix:
@@ -50,7 +50,7 @@ jobs:
5050
key: cache-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
5151
- uses: actions-rs/toolchain@v1
5252
with:
53-
toolchain: 1.80
53+
toolchain: 1.85
5454
override: true
5555
profile: minimal
5656
- name: fuzz

.github/workflows/rust.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
AS_DEPENDENCY: true
2727
DO_NO_STD: false
2828
DO_DOCS: true
29-
- rust: 1.80.0
29+
- rust: 1.85.0
3030
env:
3131
AS_DEPENDENCY: true
3232
steps:
@@ -99,7 +99,7 @@ jobs:
9999
- rust: nightly
100100
env:
101101
RUSTFMTCHK: false
102-
- rust: 1.29.0
102+
- rust: 1.85.0
103103
env:
104104
PIN_VERSIONS: true
105105
steps:

dash/Cargo.toml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ categories = ["cryptography::cryptocurrencies"]
1515
keywords = [ "crypto", "dash" ]
1616
readme = "../README.md"
1717
exclude = ["tests", "contrib"]
18-
edition = "2021"
18+
edition = "2024"
1919

2020
# Please don't forget to add relevant features to docs.rs below
2121
[features]
@@ -48,38 +48,34 @@ rustdoc-args = ["--cfg", "docsrs"]
4848

4949
[dependencies]
5050
internals = { path = "../internals", package = "dashcore-private" }
51-
bech32 = { version = "0.9.0", default-features = false }
51+
bech32 = { version = "0.9.1", default-features = false }
5252
dashcore_hashes = { path = "../hashes", default-features = false }
5353
secp256k1 = { default-features = false, features = ["hashes"], version= "0.30.0" }
54-
core2 = { version = "0.3.0", optional = true, features = ["alloc"], default-features = false }
55-
rustversion = { version="1.0.9"}
54+
core2 = { version = "0.4.0", optional = true, features = ["alloc"], default-features = false }
55+
rustversion = { version="1.0.20"}
5656
# Do NOT use this as a feature! Use the `serde` feature instead.
57-
actual-serde = { package = "serde", version = "1.0.103", default-features = false, features = [ "derive", "alloc" ], optional = true }
57+
actual-serde = { package = "serde", version = "1.0.219", default-features = false, features = [ "derive", "alloc" ], optional = true }
5858

5959
base64-compat = { version = "1.0.0", optional = true }
6060
bitcoinconsensus = { version = "0.20.2-0.5.0", default-features = false, optional = true }
6161
hex_lit = "0.1.1"
6262
anyhow = { version= "1.0" }
6363
hex = { version= "0.4" }
6464
bincode = { version= "=2.0.0-rc.3", optional = true }
65-
bitflags = "2.6.0"
65+
bitflags = "2.9.0"
6666
blsful = { version = "3.0.0-pre8", optional = true }
67-
serde_repr = "0.1.19"
68-
strum = { version = "0.26", features = ["derive"] }
69-
lazy_static = "1.5.0"
7067
ed25519-dalek = { version = "2.1", features = ["rand_core"], optional = true }
71-
blake3 = "1.5"
72-
thiserror = "1"
68+
blake3 = "1.8.1"
69+
thiserror = "2"
7370
# version 1.3.5 is 0bb5c5b03249c463debb5cef5f7e52ee66f3aaab
7471
bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0bb5c5b03249c463debb5cef5f7e52ee66f3aaab", optional = true }
7572

7673
[dev-dependencies]
77-
serde_json = "1.0.96"
78-
serde_test = "1.0.19"
79-
serde_derive = "1.0.103"
74+
serde_json = "1.0.140"
75+
serde_test = "1.0.177"
76+
serde_derive = "1.0.219"
8077
secp256k1 = { features = [ "recovery", "rand", "hashes" ], version="0.30.0" }
81-
bip39 = "2.0.0"
82-
bincode_test = {package = "bincode", version= "1.3.3" }
78+
bincode = { version= "=2.0.0-rc.3" }
8379
assert_matches = "1.5.0"
8480
dashcore = { path = ".", features = ["core-block-hash-use-x11", "message_verification", "quorum_validation", "signer"] }
8581

dash/embedded/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
authors = ["Riccardo Casatta <riccardo@casatta.it>", "Dev Random <c1.devrandom@niftybox.net>"]
3-
edition = "2018"
3+
edition = "2024"
44
readme = "README.md"
55
name = "embedded"
66
version = "0.1.0"

dash/examples/bip32.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ extern crate dashcore;
33
use std::str::FromStr;
44
use std::{env, process};
55

6+
use dashcore::PublicKey;
67
use dashcore::address::Address;
78
use dashcore::bip32::{ChildNumber, DerivationPath, ExtendedPrivKey, ExtendedPubKey};
89
use dashcore::hashes::hex::FromHex;
9-
use dashcore::secp256k1::ffi::types::AlignedType;
1010
use dashcore::secp256k1::Secp256k1;
11-
use dashcore::PublicKey;
11+
use dashcore::secp256k1::ffi::types::AlignedType;
1212

1313
fn main() {
1414
// This example derives root xprv from a 32-byte seed,

dash/examples/handshake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::net::{IpAddr, Ipv4Addr, Shutdown, SocketAddr, TcpStream};
55
use std::time::{SystemTime, UNIX_EPOCH};
66
use std::{env, process};
77

8-
use dashcore::consensus::{encode, Decodable};
8+
use dashcore::consensus::{Decodable, encode};
99
use dashcore::network::{address, constants, message, message_network};
1010
use dashcore::secp256k1;
1111
use dashcore::secp256k1::rand::Rng;
@@ -90,7 +90,7 @@ fn build_version_message(address: SocketAddr) -> message::NetworkMessage {
9090
let addr_from = address::Address::new(&my_address, constants::ServiceFlags::NONE);
9191

9292
// "Node random nonce, randomly generated every time a version packet is sent. This nonce is used to detect connections to self."
93-
let nonce: u64 = secp256k1::rand::thread_rng().gen();
93+
let nonce: u64 = rand::thread_rng().r#gen();
9494

9595
// "User Agent (0x00 if string is 0 bytes long)"
9696
let user_agent = String::from("rust-example");

dash/examples/taproot-psbt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ use dashcore::secp256k1::Secp256k1;
8888
use dashcore::sighash::{self, SighashCache, TapSighash, TapSighashType};
8989
use dashcore::taproot::{self, LeafVersion, TapLeafHash, TaprootBuilder, TaprootSpendInfo};
9090
use dashcore::{
91-
absolute, script, Address, Amount, Network, OutPoint, ScriptBuf, Transaction, TxIn, TxOut,
92-
Witness,
91+
Address, Amount, Network, OutPoint, ScriptBuf, Transaction, TxIn, TxOut, Witness, absolute,
92+
script,
9393
};
9494

9595
fn main() -> Result<(), Box<dyn std::error::Error>> {

dash/src/address.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use core::marker::PhantomData;
4747
use core::str::FromStr;
4848

4949
use bech32;
50-
use hashes::{sha256, Hash, HashEngine};
50+
use hashes::{Hash, HashEngine, sha256};
5151
use internals::write_err;
5252
use secp256k1::{Secp256k1, Verification, XOnlyPublicKey};
5353

@@ -862,7 +862,7 @@ impl<V: NetworkValidation> Address<V> {
862862
match self.payload() {
863863
Payload::PubkeyHash(_) => Some(AddressType::P2pkh),
864864
Payload::ScriptHash(_) => Some(AddressType::P2sh),
865-
Payload::WitnessProgram(ref prog) => {
865+
Payload::WitnessProgram(prog) => {
866866
// BIP-141 p2wpkh or p2wsh addresses.
867867
match prog.version() {
868868
WitnessVersion::V0 => match prog.program().len() {

dash/src/amount.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,7 @@ pub mod serde {
13781378
use core::fmt;
13791379
use core::marker::PhantomData;
13801380

1381-
use serde::{de, Deserializer, Serializer};
1381+
use serde::{Deserializer, Serializer, de};
13821382

13831383
use crate::amount::serde::SerdeAmountForOpt;
13841384

@@ -1445,7 +1445,7 @@ pub mod serde {
14451445
use core::fmt;
14461446
use core::marker::PhantomData;
14471447

1448-
use serde::{de, Deserializer, Serializer};
1448+
use serde::{Deserializer, Serializer, de};
14491449

14501450
use crate::amount::serde::SerdeAmountForOpt;
14511451

dash/src/base58.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
2424
use core::{fmt, iter, slice, str};
2525

26-
use hashes::{hex, sha256d, Hash};
26+
use hashes::{Hash, hex, sha256d};
2727
use secp256k1;
2828

2929
use crate::key;
@@ -455,8 +455,7 @@ mod tests {
455455
coinBitcoinBitcoinBitcoinBitcoinBitcoinBitcoinBitcoinBitcoinBitcoinBitcoin"
456456
.as_bytes(),
457457
);
458-
let exp =
459-
"ZqC5ZdfpZRi7fjA8hbhX5pEE96MdH9hEaC1YouxscPtbJF16qVWksHWR4wwvx7MotFcs2ChbJqK8KJ9X\
458+
let exp = "ZqC5ZdfpZRi7fjA8hbhX5pEE96MdH9hEaC1YouxscPtbJF16qVWksHWR4wwvx7MotFcs2ChbJqK8KJ9X\
460459
wZznwWn1JFDhhTmGo9v6GjAVikzCsBWZehu7bm22xL8b5zBR5AsBygYRwbFJsNwNkjpyFuDKwmsUTKvkULCvucPJrN5\
461460
QUdxpGakhqkZFL7RU4yT";
462461
assert_eq!(&res, exp);

0 commit comments

Comments
 (0)