diff --git a/Cargo.lock b/Cargo.lock index a7a6b5c517b..4e62dd62e5e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1348,7 +1348,6 @@ dependencies = [ "async-trait", "base64 0.22.1", "bip37-bloom-filter", - "bs58 0.5.1", "chrono", "ciborium", "clap 4.5.7", diff --git a/packages/rs-sdk/Cargo.toml b/packages/rs-sdk/Cargo.toml index 90b0d3de508..87550d31a3c 100644 --- a/packages/rs-sdk/Cargo.toml +++ b/packages/rs-sdk/Cargo.toml @@ -37,7 +37,6 @@ lru = { version = "0.12.3", optional = true } bip37-bloom-filter = { git = "https://github.com/dashpay/rs-bip37-bloom-filter", branch = "develop" } pollster = { version = "0.3.0" } sha2 = "0.10.8" -bs58 = "0.5.0" [dev-dependencies] tokio = { version = "1.36.0", features = ["macros", "rt-multi-thread"] } diff --git a/packages/rs-sdk/src/platform/transition/vote.rs b/packages/rs-sdk/src/platform/transition/vote.rs index d1b9161e8e1..8066e5cde6a 100644 --- a/packages/rs-sdk/src/platform/transition/vote.rs +++ b/packages/rs-sdk/src/platform/transition/vote.rs @@ -8,7 +8,6 @@ use dapi_grpc::platform::VersionedGrpcResponse; use dpp::identity::hash::IdentityPublicKeyHashMethodsV0; use dpp::identity::signer::Signer; use dpp::identity::IdentityPublicKey; -use dpp::platform_value::string_encoding::Encoding; use dpp::prelude::Identifier; use dpp::state_transition::masternode_vote_transition::methods::MasternodeVoteTransitionMethodsV0; use dpp::state_transition::masternode_vote_transition::MasternodeVoteTransition; @@ -58,17 +57,15 @@ impl PutVote for Vote { hasher.update(voter_pro_tx_hash.as_bytes()); hasher.update(pub_key_hash); let voting_identity_id_hashed = hasher.finalize(); - let voting_identity_id_bs58 = bs58::encode(voting_identity_id_hashed).into_string(); - let voting_identity_id = - match Identifier::from_string(&voting_identity_id_bs58, Encoding::Base58) { - Ok(id) => id, - Err(e) => { - return Err(Error::Generic(format!( - "Couldn't convert id string to Identifier: {}", - e - ))) - } - }; + let voting_identity_id = match Identifier::from_bytes(&voting_identity_id_hashed) { + Ok(id) => id, + Err(e) => { + return Err(Error::Generic(format!( + "Couldn't convert id string to Identifier: {}", + e + ))) + } + }; let new_masternode_voting_nonce = sdk .get_identity_nonce(voting_identity_id, true, settings) @@ -106,17 +103,15 @@ impl PutVote for Vote { hasher.update(voter_pro_tx_hash.as_bytes()); hasher.update(pub_key_hash); let voting_identity_id_hashed = hasher.finalize(); - let voting_identity_id_bs58 = bs58::encode(voting_identity_id_hashed).into_string(); - let voting_identity_id = - match Identifier::from_string(&voting_identity_id_bs58, Encoding::Base58) { - Ok(id) => id, - Err(e) => { - return Err(Error::Generic(format!( - "Couldn't convert id string to Identifier: {}", - e - ))) - } - }; + let voting_identity_id = match Identifier::from_bytes(&voting_identity_id_hashed) { + Ok(id) => id, + Err(e) => { + return Err(Error::Generic(format!( + "Couldn't convert id string to Identifier: {}", + e + ))) + } + }; let new_masternode_voting_nonce = sdk .get_identity_nonce(voting_identity_id, true, settings)