-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cw-abc: Updated hatch phase mechanics, donations, queries (#699)
* Separate hatcher allowlist * Donation feature * Initial sell exit tax * Hatchers to amount * Hatch phase exit tax * TokenMsg methods * Format * Hatchers query * Fix bug where float was not taken into account in supply * Buy and sell refactoring * Update hatch phase config * Update phase config enum * Add adairrr to authors * Initial boot integration with custom msgs * Initial testing infrastructure * Abstract-OS to AbstractSDK
- Loading branch information
1 parent
f88c365
commit 8788798
Showing
11 changed files
with
973 additions
and
416 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
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,43 @@ | ||
use crate::msg::*; | ||
use boot_core::{contract, Contract, CwEnv}; | ||
#[cfg(feature = "daemon")] | ||
use boot_core::{ArtifactsDir, Daemon, WasmPath}; | ||
use boot_core::{ContractWrapper, Mock, MockState, TxHandler, Uploadable}; | ||
use cosmwasm_std::Empty; | ||
use token_bindings::{TokenFactoryMsg, TokenFactoryQuery}; | ||
|
||
#[contract(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)] | ||
pub struct CwAbc<Chain>; | ||
|
||
impl<Chain: CwEnv> CwAbc<Chain> { | ||
pub fn new(name: &str, chain: Chain) -> Self { | ||
let contract = Contract::new(name, chain); | ||
Self(contract) | ||
} | ||
} | ||
|
||
/// Basic app for the token factory contract | ||
/// TODO: should be in the bindings, along with custom handler for multi-test | ||
pub(crate) type TokenFactoryBasicApp = boot_core::BasicApp<TokenFactoryMsg, TokenFactoryQuery>; | ||
|
||
type TokenFactoryMock = Mock<MockState, TokenFactoryMsg, TokenFactoryQuery>; | ||
|
||
impl Uploadable<TokenFactoryMock> for CwAbc<TokenFactoryMock> { | ||
fn source(&self) -> <TokenFactoryMock as TxHandler>::ContractSource { | ||
Box::new(ContractWrapper::new( | ||
crate::contract::execute, | ||
crate::contract::instantiate, | ||
crate::contract::query, | ||
)) | ||
} | ||
} | ||
|
||
#[cfg(feature = "daemon")] | ||
impl Uploadable<Daemon> for CwAbc<Daemon> { | ||
fn source(&self) -> <Daemon as TxHandler>::ContractSource { | ||
ArtifactsDir::env() | ||
.expect("Expected ARTIFACTS_DIR in env") | ||
.find_wasm_path("cw_abc") | ||
.unwrap() | ||
} | ||
} |
Oops, something went wrong.