diff --git a/core/primitives-core/src/hash.rs b/core/primitives-core/src/hash.rs index 23c464adbf0..e50b508be2b 100644 --- a/core/primitives-core/src/hash.rs +++ b/core/primitives-core/src/hash.rs @@ -6,7 +6,7 @@ use sha2::Digest; use crate::borsh::BorshSerialize; use crate::logging::pretty_hash; -use crate::serialize::{from_base, to_base, BaseDecode}; +use crate::serialize::{from_base, to_base}; #[cfg_attr(feature = "deepsize_feature", derive(deepsize::DeepSizeOf))] #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, derive_more::AsRef, derive_more::AsMut)] @@ -40,8 +40,6 @@ impl Default for CryptoHash { } } -impl BaseDecode for CryptoHash {} - impl borsh::BorshSerialize for CryptoHash { fn serialize(&self, writer: &mut W) -> Result<(), std::io::Error> { writer.write_all(&self.0)?; diff --git a/core/primitives-core/src/serialize.rs b/core/primitives-core/src/serialize.rs index caabfadeb72..3067ad18b37 100644 --- a/core/primitives-core/src/serialize.rs +++ b/core/primitives-core/src/serialize.rs @@ -37,15 +37,6 @@ where } } -pub trait BaseDecode: - for<'a> TryFrom<&'a [u8], Error = Box> -{ - fn from_base(s: &str) -> Result> { - let bytes = from_base(s)?; - Self::try_from(&bytes) - } -} - pub mod base64_format { use serde::de; use serde::{Deserialize, Deserializer, Serializer}; diff --git a/integration-tests/src/tests/client/challenges.rs b/integration-tests/src/tests/client/challenges.rs index 99dcee8de69..95b885f67fc 100644 --- a/integration-tests/src/tests/client/challenges.rs +++ b/integration-tests/src/tests/client/challenges.rs @@ -19,7 +19,6 @@ use near_primitives::hash::CryptoHash; use near_primitives::merkle::{merklize, MerklePath, PartialMerkleTree}; use near_primitives::num_rational::Ratio; use near_primitives::receipt::Receipt; -use near_primitives::serialize::BaseDecode; use near_primitives::shard_layout::ShardUId; use near_primitives::sharding::{EncodedShardChunk, ReedSolomonWrapper}; use near_primitives::transaction::SignedTransaction; @@ -183,7 +182,7 @@ fn create_invalid_proofs_chunk( create_chunk( client, None, - Some(CryptoHash::from_base("F5SvmQcKqekuKPJgLUNFgjB4ZgVmmiHsbDhTBSQbiywf").unwrap()), + Some("F5SvmQcKqekuKPJgLUNFgjB4ZgVmmiHsbDhTBSQbiywf".parse::().unwrap()), ) }