Skip to content

Commit 0a57e76

Browse files
chore: move BLS Sigs import to Rust Dash Core (#2252)
1 parent 5c639bf commit 0a57e76

File tree

12 files changed

+37
-31
lines changed

12 files changed

+37
-31
lines changed

Cargo.lock

Lines changed: 17 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/rs-dpp/Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ authors = [
1515
anyhow = { version = "1.0.81" }
1616
async-trait = { version = "0.1.79" }
1717
base64 = "0.22.1"
18-
bls-signatures = { git = "https://github.com/dashpay/bls-signatures", tag = "v1.3.1", optional = true }
1918
bs58 = "0.5"
2019
byteorder = { version = "1.4" }
2120
chrono = { version = "0.4.35", default-features = false, features = [
@@ -29,7 +28,9 @@ dashcore = { git = "https://github.com/dashpay/rust-dashcore", features = [
2928
"rand",
3029
"signer",
3130
"serde",
32-
], default-features = false, tag = "0.31.0" }
31+
"bls",
32+
"eddsa"
33+
], default-features = false, tag = "0.32.0" }
3334
env_logger = { version = "0.11" }
3435
getrandom = { version = "0.2", features = ["js"] }
3536
hex = { version = "0.4" }
@@ -56,7 +57,6 @@ platform-versioning = { path = "../rs-platform-versioning" }
5657
platform-serialization = { path = "../rs-platform-serialization" }
5758
platform-serialization-derive = { path = "../rs-platform-serialization-derive" }
5859
derive_more = { version = "1.0", features = ["from", "display"] }
59-
ed25519-dalek = { version = "2.1", features = ["rand_core"], optional = true }
6060
nohash-hasher = "0.2.0"
6161
rust_decimal = "1.29.1"
6262
rust_decimal_macros = "1.29.1"
@@ -75,6 +75,8 @@ once_cell = "1.7"
7575

7676
[features]
7777
default = ["platform-value", "state-transitions"]
78+
bls-signatures = ["dashcore/bls"]
79+
ed25519-dalek = ["dashcore/eddsa"]
7880
all_features = [
7981
"json-object",
8082
"platform-value",

packages/rs-dpp/src/bls/native_bls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{BlsModule, ProtocolError, PublicKeyValidationError};
22
use anyhow::anyhow;
3-
use bls_signatures::{PrivateKey, PublicKey};
3+
use dashcore::bls_signatures::{self, PrivateKey, PublicKey};
44

55
#[derive(Default)]
66
pub struct NativeBlsModule;

packages/rs-dpp/src/identity/identity_public_key/key_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use dashcore::secp256k1::rand::rngs::StdRng as EcdsaRng;
88
#[cfg(feature = "random-public-keys")]
99
use dashcore::secp256k1::rand::SeedableRng;
1010
use dashcore::secp256k1::Secp256k1;
11-
use dashcore::Network;
11+
use dashcore::{bls_signatures, ed25519_dalek, Network};
1212
use itertools::Itertools;
1313
use lazy_static::lazy_static;
1414

packages/rs-dpp/src/identity/identity_public_key/v0/methods/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use anyhow::anyhow;
77
use dashcore::hashes::Hash;
88
use dashcore::key::Secp256k1;
99
use dashcore::secp256k1::SecretKey;
10-
use dashcore::{Network, PublicKey as ECDSAPublicKey};
10+
use dashcore::{bls_signatures, ed25519_dalek, Network, PublicKey as ECDSAPublicKey};
1111
use platform_value::Bytes20;
1212

1313
impl IdentityPublicKeyHashMethodsV0 for IdentityPublicKeyV0 {

packages/rs-dpp/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ pub mod prelude {
9090

9191
pub use bincode;
9292
#[cfg(all(not(target_arch = "wasm32"), feature = "bls-signatures"))]
93-
pub use bls_signatures;
93+
pub use dashcore::bls_signatures;
94+
#[cfg(feature = "ed25519-dalek")]
95+
pub use dashcore::ed25519_dalek;
9496
#[cfg(feature = "system_contracts")]
9597
pub use data_contracts;
96-
#[cfg(feature = "ed25519-dalek")]
97-
pub use ed25519_dalek;
9898
#[cfg(feature = "jsonschema")]
9999
pub use jsonschema;
100100
pub use platform_serialization;

packages/rs-dpp/src/signing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::serialization::PlatformMessageSignable;
88
use crate::validation::SimpleConsensusValidationResult;
99
#[cfg(feature = "message-signing")]
1010
use crate::{BlsModule, ProtocolError};
11-
use dashcore::signer;
11+
use dashcore::{bls_signatures, signer};
1212

1313
impl PlatformMessageSignable for &[u8] {
1414
#[cfg(feature = "message-signature-verification")]

packages/rs-drive-abci/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ rand = "0.8.5"
2828
tempfile = "3.3.0"
2929
hex = "0.4.3"
3030
indexmap = { version = "2.2.6", features = ["serde"] }
31-
dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore-rpc", tag = "v0.15.7" }
31+
dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore-rpc", tag = "v0.15.8" }
3232
dpp = { path = "../rs-dpp", features = ["abci"] }
3333
simple-signer = { path = "../simple-signer" }
3434
rust_decimal = "1.2.5"

packages/rs-drive-abci/src/execution/check_tx/v0/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ mod tests {
213213

214214
use dpp::consensus::ConsensusError;
215215
use dpp::dashcore::secp256k1::Secp256k1;
216-
use dpp::dashcore::{key::KeyPair, signer, Network, PrivateKey};
216+
use dpp::dashcore::{key::Keypair, signer, Network, PrivateKey};
217217

218218
use dpp::data_contract::accessors::v0::{DataContractV0Getters, DataContractV0Setters};
219219
use dpp::data_contract::document_type::random_document::{
@@ -2659,7 +2659,7 @@ mod tests {
26592659

26602660
let secp = Secp256k1::new();
26612661

2662-
let new_key_pair = KeyPair::new(&secp, &mut rng);
2662+
let new_key_pair = Keypair::new(&secp, &mut rng);
26632663

26642664
let mut new_key = IdentityPublicKeyInCreationV0 {
26652665
id: 2,
@@ -2760,7 +2760,7 @@ mod tests {
27602760

27612761
let platform_state = platform.state.load();
27622762

2763-
let new_key_pair = KeyPair::new(&secp, &mut rng);
2763+
let new_key_pair = Keypair::new(&secp, &mut rng);
27642764

27652765
let new_key = IdentityPublicKeyInCreationV0 {
27662766
id: 2,

packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_update/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ mod tests {
122122
use dpp::block::block_info::BlockInfo;
123123
use dpp::consensus::ConsensusError;
124124
use dpp::dash_to_credits;
125-
use dpp::dashcore::key::{KeyPair, Secp256k1};
125+
use dpp::dashcore::key::{Keypair, Secp256k1};
126126
use dpp::data_contract::accessors::v0::DataContractV0Getters;
127127
use dpp::identity::accessors::IdentityGettersV0;
128128
use dpp::identity::contract_bounds::ContractBounds;
@@ -371,7 +371,7 @@ mod tests {
371371

372372
let mut rng = StdRng::seed_from_u64(1292);
373373

374-
let new_key_pair = KeyPair::new(&secp, &mut rng);
374+
let new_key_pair = Keypair::new(&secp, &mut rng);
375375

376376
let new_key = IdentityPublicKeyInCreationV0 {
377377
id: 2,

0 commit comments

Comments
 (0)