forked from DA0-DA0/dao-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use cw-denom and payment utils in gauge adapter
TODO: 2 tests are failing, because the cw20 cannot be validated with cw-denom. This should be fixed with a cw-orch refactor.
- Loading branch information
Showing
11 changed files
with
155 additions
and
147 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
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,27 @@ | ||
use cosmwasm_std::Deps; | ||
use cw_denom::{DenomError, UncheckedDenom}; | ||
|
||
use crate::{msg::AssetUnchecked, state::Asset}; | ||
|
||
impl AssetUnchecked { | ||
pub fn into_checked(self, deps: Deps) -> Result<Asset, DenomError> { | ||
Ok(Asset { | ||
denom: self.denom.into_checked(deps)?, | ||
amount: self.amount, | ||
}) | ||
} | ||
|
||
pub fn new_native(denom: &str, amount: u128) -> Self { | ||
Self { | ||
denom: UncheckedDenom::Native(denom.to_owned()), | ||
amount: amount.into(), | ||
} | ||
} | ||
|
||
pub fn new_cw20(denom: &str, amount: u128) -> Self { | ||
Self { | ||
denom: UncheckedDenom::Cw20(denom.to_owned()), | ||
amount: amount.into(), | ||
} | ||
} | ||
} |
Oops, something went wrong.