-
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.
#7 This reworks the message passing in the Arena protocol. Instead of passing Arena tax config around, let's just store this in the Arena core and return when querying for tax. From here, we can send an ordered list of layered fees to automatically send when distributing an escrow. Additional layered fees are saved directly on the competition and are optional. Also cleans up states on migrations.
- Loading branch information
Showing
51 changed files
with
1,299 additions
and
442 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.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
pub mod contract; | ||
mod error; | ||
pub mod execute; | ||
mod migrate; | ||
pub mod query; | ||
pub mod state; | ||
|
||
|
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,39 @@ | ||
use arena_core_interface::fees::TaxConfiguration; | ||
use cosmwasm_std::{from_json, DepsMut, StdError, Uint128}; | ||
|
||
use crate::{ | ||
state::{ARENA_TAX_CONFIG, COMPETITION_CATEGORIES_COUNT, COMPETITION_MODULES_COUNT}, | ||
ContractError, | ||
}; | ||
|
||
pub fn from_v1_3_to_v_1_4(deps: DepsMut) -> Result<(), ContractError> { | ||
let prev_key = "competition-categories-count".as_bytes(); | ||
|
||
let competition_categories_count: Uint128 = from_json( | ||
deps.storage | ||
.get(prev_key) | ||
.ok_or_else(|| StdError::not_found("State"))?, | ||
)?; | ||
deps.storage.remove(prev_key); | ||
COMPETITION_CATEGORIES_COUNT.save(deps.storage, &competition_categories_count)?; | ||
|
||
let prev_key = "competition-modules-count".as_bytes(); | ||
|
||
let competition_modules_count: Uint128 = from_json( | ||
deps.storage | ||
.get(prev_key) | ||
.ok_or_else(|| StdError::not_found("State"))?, | ||
)?; | ||
deps.storage.remove(prev_key); | ||
COMPETITION_MODULES_COUNT.save(deps.storage, &competition_modules_count)?; | ||
|
||
ARENA_TAX_CONFIG.save( | ||
deps.storage, | ||
&TaxConfiguration { | ||
cw20_msg: None, | ||
cw721_msg: None, | ||
}, | ||
)?; | ||
|
||
Ok(()) | ||
} |
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
Oops, something went wrong.