generated from AbstractSDK/templates
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb8df96
commit ee5dc2f
Showing
25 changed files
with
200 additions
and
150 deletions.
There are no files selected for viewing
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
File renamed without changes.
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
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,10 @@ | ||
use serde::{Serialize, Deserialize}; | ||
|
||
#[derive(Serialize, Deserialize)] | ||
pub struct Data { | ||
name: String, | ||
|
||
age: i64, | ||
|
||
sex: String, | ||
} |
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,44 @@ | ||
use crate::{ | ||
contract::{Intersync, IntersyncResult}, | ||
msg::IntersyncExecuteMsg, | ||
state::{CONFIG, COUNT}, | ||
}; | ||
|
||
use abstract_app::traits::AbstractResponse; | ||
use cosmwasm_std::{DepsMut, Env, MessageInfo}; | ||
|
||
pub fn execute_handler( | ||
deps: DepsMut, | ||
_env: Env, | ||
info: MessageInfo, | ||
app: Intersync, | ||
msg: IntersyncExecuteMsg, | ||
) -> IntersyncResult { | ||
match msg { | ||
IntersyncExecuteMsg::UpdateConfig {} => update_config(deps, info, app), | ||
Check failure on line 18 in contracts/intersync/src/handlers/execute.rs GitHub Actions / clippyno variant named `UpdateConfig` found for enum `msg::IntersyncExecuteMsg`
|
||
IntersyncExecuteMsg::Increment {} => increment(deps, app), | ||
Check failure on line 19 in contracts/intersync/src/handlers/execute.rs GitHub Actions / clippyno variant named `Increment` found for enum `msg::IntersyncExecuteMsg`
|
||
IntersyncExecuteMsg::Reset { count } => reset(deps, info, count, app), | ||
Check failure on line 20 in contracts/intersync/src/handlers/execute.rs GitHub Actions / clippyno variant named `Reset` found for enum `msg::IntersyncExecuteMsg`
|
||
} | ||
} | ||
|
||
/// Update the configuration of the app | ||
fn update_config(deps: DepsMut, msg_info: MessageInfo, app: Intersync) -> IntersyncResult { | ||
// Only the admin should be able to call this | ||
app.admin.assert_admin(deps.as_ref(), &msg_info.sender)?; | ||
let mut _config = CONFIG.load(deps.storage)?; | ||
|
||
Ok(app.response("update_config")) | ||
} | ||
|
||
fn increment(deps: DepsMut, app: Intersync) -> IntersyncResult { | ||
COUNT.update(deps.storage, |count| IntersyncResult::Ok(count + 1))?; | ||
|
||
Ok(app.response("increment")) | ||
} | ||
|
||
fn reset(deps: DepsMut, info: MessageInfo, count: i32, app: Intersync) -> IntersyncResult { | ||
app.admin.assert_admin(deps.as_ref(), &info.sender)?; | ||
COUNT.save(deps.storage, &count)?; | ||
|
||
Ok(app.response("reset")) | ||
} |
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
File renamed without changes.
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
30 changes: 17 additions & 13 deletions
30
contracts/my-app/src/msg.rs → contracts/intersync/src/msg.rs
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,8 @@ | ||
use crate::contract::{Intersync, IntersyncResult}; | ||
|
||
use abstract_app::traits::AbstractResponse; | ||
use cosmwasm_std::{DepsMut, Env, Reply}; | ||
|
||
pub fn instantiate_reply(_deps: DepsMut, _env: Env, app: Intersync, _reply: Reply) -> IntersyncResult { | ||
Ok(app.response("instantiate_reply")) | ||
} |
File renamed without changes.
Oops, something went wrong.