-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix!: Expect
,
in :custom(msg, query)
- Loading branch information
Showing
9 changed files
with
55 additions
and
19 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use crate::messages::CounterMsg; | ||
use cosmwasm_std::{CosmosMsg, Response, StdError, StdResult}; | ||
use cw1::{CanExecuteResp, Cw1}; | ||
use sylvia::contract; | ||
use sylvia::types::{ExecCtx, QueryCtx}; | ||
|
||
use crate::contract::CustomContract; | ||
|
||
#[contract(module=crate::contract)] | ||
#[messages(cw1 as Cw1)] | ||
#[sv::custom(query=CounterQuery, msg=CounterMsg)] | ||
impl Cw1 for CustomContract { | ||
type Error = StdError; | ||
|
||
#[msg(exec)] | ||
fn execute(&self, _ctx: ExecCtx, _msgs: Vec<CosmosMsg>) -> StdResult<Response> { | ||
Ok(Response::new()) | ||
} | ||
|
||
#[msg(query)] | ||
fn can_execute( | ||
&self, | ||
_ctx: QueryCtx, | ||
_sender: String, | ||
_msg: CosmosMsg, | ||
) -> StdResult<CanExecuteResp> { | ||
Ok(CanExecuteResp::default()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod contract; | ||
pub mod cw1; | ||
pub mod messages; | ||
#[cfg(any(test, feature = "mt"))] | ||
pub mod multitest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
mod custom_module; | ||
pub mod custom_module; | ||
#[cfg(test)] | ||
mod tests; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters