From 78098b22cca38ff7ff34b19d304f37f63e253392 Mon Sep 17 00:00:00 2001 From: code0xff Date: Tue, 10 Sep 2024 10:20:39 +0900 Subject: [PATCH] fix: Rename the error in AddressError --- frame/cosmos/types/Cargo.toml | 6 ------ frame/cosmos/types/src/address.rs | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/frame/cosmos/types/Cargo.toml b/frame/cosmos/types/Cargo.toml index 2a3aa4c..1572362 100644 --- a/frame/cosmos/types/Cargo.toml +++ b/frame/cosmos/types/Cargo.toml @@ -26,13 +26,9 @@ serde_json = { workspace = true, default-features = false, optional = true } # Substrate frame-support = { workspace = true, default-features = false } impl-trait-for-tuples = { workspace = true } -sp-core = { workspace = true, default-features = false } -sp-runtime-interface = { workspace = true, default-features = false } sp-runtime = { workspace = true, default-features = false } [dev-dependencies] -array-bytes = { workspace = true } -base64ct = { workspace = true, features = ["alloc"] } hex = { workspace = true, default-features = false } [features] @@ -45,8 +41,6 @@ std = [ "scale-info/std", "serde/std", "serde_json/std", - "sp-core/std", - "sp-runtime-interface/std", "sp-runtime/std", "hex/std", ] diff --git a/frame/cosmos/types/src/address.rs b/frame/cosmos/types/src/address.rs index 5f2d50f..891dba7 100644 --- a/frame/cosmos/types/src/address.rs +++ b/frame/cosmos/types/src/address.rs @@ -22,18 +22,18 @@ use alloc::{ #[derive(Clone, PartialEq, Eq, Debug)] pub enum AddressError { - Bech32Error(bech32::DecodeError), + DecodeError(bech32::DecodeError), } pub fn acc_address_from_bech32(address: &str) -> Result<(String, Vec), AddressError> { bech32::decode(address) .map(|(hrp, data)| (hrp.to_string(), data)) - .map_err(AddressError::Bech32Error) + .map_err(AddressError::DecodeError) } #[cfg(test)] mod tests { - use super::acc_address_from_bech32; + use super::*; #[test] fn acc_address_from_bech32_test() {