Skip to content

Commit

Permalink
Merge pull request #38 from burnt-labs/chore/unneeded-import
Browse files Browse the repository at this point in the history
consolidate import
  • Loading branch information
ash-burnt authored Nov 6, 2024
2 parents 2fd8d92 + 424c413 commit 62df0e4
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/optimizer:0.16.0
cosmwasm/optimizer:0.16.1
```
1 change: 0 additions & 1 deletion contracts/account/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ crate-type = ["cdylib", "rlib"]
library = []

[dependencies]
absacc = { git = "https://github.com/burnt-labs/abstract-account.git", rev = "4e376f2f399f17e50016a932d4e5af7336d952d7" }
cosmwasm-schema = { workspace = true }
cosmwasm-std = { workspace = true }
cw2 = { workspace = true }
Expand Down
39 changes: 37 additions & 2 deletions contracts/account/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
pub use absacc::AccountSudoMsg;
use cosmwasm_std::{to_json_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdResult};
use cosmwasm_schema::cw_serde;
use cosmwasm_std::{
to_json_binary, AnyMsg, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdResult,
};

use crate::error::ContractError;
use crate::execute::{add_auth_method, assert_self, remove_auth_method};
Expand All @@ -22,6 +24,39 @@ pub fn instantiate(
execute::init(deps, env, &mut msg.authenticator.clone())
}

/// Any contract must implement this sudo message (both variants) in order to
/// qualify as an abstract account.
#[cw_serde]
pub enum AccountSudoMsg {
/// Called by the AnteHandler's BeforeTxDecorator before a tx is executed.
BeforeTx {
/// Messages the tx contains
msgs: Vec<AnyMsg>,

/// The tx serialized into binary format.
///
/// If the tx authentication requires a signature, this is the bytes to
/// be signed.
tx_bytes: Binary,

/// The credential to prove this tx is authenticated.
///
/// This is taken from the tx's "signature" field, but in the case of
/// AbstractAccounts, this is not necessarily a cryptographic signature.
/// The contract is free to interpret this as any data type.
cred_bytes: Option<Binary>,

/// Whether the tx is being run in the simulation mode.
simulate: bool,
},

/// Called by the PostHandler's AfterTxDecorator after the tx is executed.
AfterTx {
/// Whether the tx is being run in the simulation mode.
simulate: bool,
},
}

#[cfg_attr(not(feature = "library"), cosmwasm_std::entry_point)]
pub fn sudo(deps: DepsMut, env: Env, msg: AccountSudoMsg) -> ContractResult<Response> {
match msg {
Expand Down

0 comments on commit 62df0e4

Please sign in to comment.