Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Commit

Permalink
more styling changes
Browse files Browse the repository at this point in the history
  • Loading branch information
larry0x committed Jun 3, 2022
1 parent 854c15c commit f86e9aa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
24 changes: 11 additions & 13 deletions contracts/token/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@ pub fn execute(
// For `burn`, we assert that the caller is the minter
// For `burn_from`, we simply disable it
match msg {
ExecuteMsg::Burn {
..
} => assert_minter(deps.storage, &info.sender)?,
ExecuteMsg::BurnFrom {
..
} => return Err(StdError::generic_err("`burn_from` command is disabled").into()),
ExecuteMsg::Burn { .. } => assert_minter(deps.storage, &info.sender)?,
ExecuteMsg::BurnFrom { .. } => return Err(StdError::generic_err("`burn_from` command is disabled").into()),
_ => (),
}

Expand All @@ -44,11 +40,7 @@ pub fn execute(
fn assert_minter(storage: &dyn Storage, sender: &Addr) -> Result<(), ContractError> {
let token_info = TOKEN_INFO.load(storage)?;

if let Some(MinterData {
minter,
..
}) = &token_info.mint
{
if let Some(MinterData { minter, .. }) = &token_info.mint {
if sender != minter {
return Err(StdError::generic_err("only minter can execute token burn").into());
}
Expand Down Expand Up @@ -92,11 +84,17 @@ mod tests {
.unwrap();

BALANCES
.save(deps.as_mut().storage, &Addr::unchecked("steak_hub"), &Uint128::new(100))
.save(
deps.as_mut().storage,
&Addr::unchecked("steak_hub"),
&Uint128::new(100))
.unwrap();

BALANCES
.save(deps.as_mut().storage, &Addr::unchecked("alice"), &Uint128::new(100))
.save(
deps.as_mut().storage,
&Addr::unchecked("alice"),
&Uint128::new(100))
.unwrap();

deps
Expand Down
2 changes: 1 addition & 1 deletion packages/steak/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "steak"
version = "2.0.0"
authors = ["larry <[email protected]>","PFC <[email protected]>"]
authors = ["larry <[email protected]>", "PFC <[email protected]>"]
edition = "2018"
description = "Liquid staking protocol for the cosmos"
license = "GPL-3.0-or-later"
Expand Down
3 changes: 1 addition & 2 deletions scripts/2_deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ async function uploadCode(deployer: Wallet, path: string) {
hubCodeId,
msg
);
const address =
result.logs[0].eventsByType["instantiate_contract"]["contract_address"][0];
const address = result.logs[0].eventsByType["instantiate_contract"]["contract_address"][0];
console.log(`Contract instantiated! Address: ${address}`);
})();

0 comments on commit f86e9aa

Please sign in to comment.