Skip to content

Commit

Permalink
it all finally builds!!!! yay!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Rodriguez committed Mar 18, 2024
1 parent 7281073 commit 9e3a5ce
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/bin/schema.rs
Original file line number Diff line number Diff line change
@@ -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,
}
}
22 changes: 15 additions & 7 deletions src/error.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
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;
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}")]
Expand All @@ -28,10 +30,16 @@ pub enum ContractError {
ProtoDecode(prost::DecodeError),
}

impl Error for ContractError {}
impl StdError for ContractError {}

impl From<ContractError> for CwError {
fn from(err: ContractError) -> CwError {
CwError::generic_err(err.to_string())
}
}

impl From<ContractError> for StdError {
fn from(err: ContractError) -> StdError {
StdError::generic_err(err.to_string())
impl From<Error> for ContractError {
fn from(err: Error) -> ContractError {
ContractError::Std(CwError::generic_err(err.origin))
}
}
1 change: 1 addition & 0 deletions src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion src/types/da_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
}
}
Expand Down

0 comments on commit 9e3a5ce

Please sign in to comment.