diff --git a/pallets/types/src/evm.rs b/pallets/types/src/evm.rs index 8c1c379c..d9a0ecdd 100644 --- a/pallets/types/src/evm.rs +++ b/pallets/types/src/evm.rs @@ -268,8 +268,7 @@ pub struct InboundCommitment> { impl> InboundCommitment { pub fn hash(&self) -> H256 { - ("evm-inbound", self) - .using_encoded(|encoded| sp_runtime::traits::Keccak256::hash(&encoded[..])) + ("evm-inbound", self).using_encoded(|encoded| sp_runtime::traits::Keccak256::hash(encoded)) } } @@ -303,7 +302,7 @@ pub struct StatusReport> { impl> StatusReport { pub fn hash(&self) -> H256 { ("evm-status-report", self) - .using_encoded(|encoded| sp_runtime::traits::Keccak256::hash(&encoded[..])) + .using_encoded(|encoded| sp_runtime::traits::Keccak256::hash(encoded)) } } @@ -325,7 +324,7 @@ pub struct BaseFeeUpdate { impl BaseFeeUpdate { pub fn hash(&self) -> H256 { ("base-fee-update", self) - .using_encoded(|encoded| sp_runtime::traits::Keccak256::hash(&encoded[..])) + .using_encoded(|encoded| sp_runtime::traits::Keccak256::hash(encoded)) } } diff --git a/pallets/types/src/substrate.rs b/pallets/types/src/substrate.rs index 3c4eab0b..3ad2a15b 100644 --- a/pallets/types/src/substrate.rs +++ b/pallets/types/src/substrate.rs @@ -29,12 +29,12 @@ // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #![allow(clippy::large_enum_variant)] +use crate::{H160, H256}; use codec::{Decode, Encode}; use derivative::Derivative; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; use sp_core::{ecdsa, Get}; -use crate::{H256, H160}; use sp_runtime::{traits::Hash, BoundedVec, RuntimeDebug}; use sp_std::prelude::*;