Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ Forward Response.data on Execute message on DataRequest to Proxy contract #73

Merged
merged 4 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 59 additions & 55 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ cosmwasm-std = { version = "1.4", features = ["staking"] }
cosmwasm-storage = "1.1.3"
cw-storage-plus = "1.1"
cw2 = "1.1"
cw-utils = "1.0.1"
hex = "0.4.3"
proxy-contract = { path = "./packages/proxy" }
schemars = "0.8.10"
Expand All @@ -35,4 +36,3 @@ serde = { version = "1.0.145", default-features = false, features = ["derive"] }
serde_json = "1.0.107"
sha3 = "0.10.8"
thiserror = { version = "1.0.31" }
wasm-bin-storage = { path = "./packages/wasm-bin-storage" }
2 changes: 2 additions & 0 deletions packages/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ edition = "2021"
[dependencies]
cosmwasm-schema = { workspace = true }
cosmwasm-std = { workspace = true }
cw-utils = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
thiserror = { workspace = true }
hex = { workspace = true }
17 changes: 17 additions & 0 deletions packages/common/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use crate::types::Hash;
use cosmwasm_std::StdError;
use cw_utils::ParseReplyError;
use hex::FromHexError;
use thiserror::Error;

#[derive(Error, Debug, PartialEq)]
pub enum ContractError {
// staking contract errors
Expand Down Expand Up @@ -40,4 +43,18 @@ pub enum ContractError {
ContractAlreadySet,
#[error("Caller must be the contract creator")]
NotContractCreator,
#[error("Unknown reply ID: {0}")]
UnknownReplyId(String),
#[error("Unexpected error: {0}")]
UnexpectedError(String),
#[error(transparent)]
ParseReplyError(#[from] ParseReplyError),
#[error("Invalid hexadecimal input: {0}")]
FromHex(FromHexError),
}

impl From<FromHexError> for ContractError {
fn from(err: FromHexError) -> Self {
ContractError::FromHex(err)
}
}
Loading
Loading