diff --git a/src/bin/schema.rs b/src/bin/schema.rs index c072ed4..9036968 100644 --- a/src/bin/schema.rs +++ b/src/bin/schema.rs @@ -1,11 +1,11 @@ use cosmwasm_schema::write_api; -use rollkit_ibc::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use rollkit_ibc::msg::{InstantiateMsg, SudoMsg}; fn main() { write_api! { instantiate: InstantiateMsg, - execute: ExecuteMsg, - query: QueryMsg, + sudo: SudoMsg, + // query: QueryMsg, } } diff --git a/src/error.rs b/src/error.rs index 1e758df..a3eec83 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,7 +1,7 @@ use alloc::string::String; -use std::error::Error; +use std::error::Error as StdError; -use cosmwasm_std::StdError; +use cosmwasm_std::StdError as CwError; use derive_more::{Display, From}; use ibc::core::client::types::error::ClientError; use ibc::core::commitment_types::error::CommitmentError; @@ -9,9 +9,11 @@ use ibc::core::handler::types::error::ContextError; use ibc::core::host::types::error::IdentifierError; use ibc::core::host::types::path::PathError; +use crate::types::Error; + #[derive(From, Display, Debug)] pub enum ContractError { - Std(StdError), + Std(CwError), #[display(fmt = "invalid message: {_0}")] InvalidMsg(String), #[display(fmt = "IBC validation/execution context error: {_0}")] @@ -28,10 +30,16 @@ pub enum ContractError { ProtoDecode(prost::DecodeError), } -impl Error for ContractError {} +impl StdError for ContractError {} + +impl From for CwError { + fn from(err: ContractError) -> CwError { + CwError::generic_err(err.to_string()) + } +} -impl From for StdError { - fn from(err: ContractError) -> StdError { - StdError::generic_err(err.to_string()) +impl From for ContractError { + fn from(err: Error) -> ContractError { + ContractError::Std(CwError::generic_err(err.origin)) } } diff --git a/src/msg.rs b/src/msg.rs index 84e5079..5a1d753 100644 --- a/src/msg.rs +++ b/src/msg.rs @@ -264,6 +264,7 @@ pub struct MigrateClientStoreMsg {} // ------------------------------------------------------------ #[cw_serde] +// #[derive(QueryResponses)] TODO: we might want to add this macro, but it didn't for now because it required some extra work and it's not strictly necessary. pub enum QueryMsg { Status(StatusMsg), ExportMetadata(ExportMetadataMsg), diff --git a/src/types/da_data.rs b/src/types/da_data.rs index 8fe40b5..93537c8 100644 --- a/src/types/da_data.rs +++ b/src/types/da_data.rs @@ -29,7 +29,7 @@ impl Display for DaData { f, "DaData {{ client_id: {}, shared_proof: {} }}", &self.client_id, - &general_purpose::STANDARD.encode(self.shared_proof) + &general_purpose::STANDARD.encode(&self.shared_proof) ) } }