Skip to content

Commit

Permalink
Clean up code comments from #724
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Hartnell committed Aug 18, 2023
1 parent 854bc32 commit 0a47b53
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion contracts/voting/dao-voting-native-staked/src/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use crate::state::HOOKS;
use cosmwasm_schema::cw_serde;
use cosmwasm_std::{to_binary, Addr, StdResult, Storage, SubMsg, Uint128, WasmMsg};

// This is just a helper to properly serialize the above message
#[cw_serde]
pub enum StakeChangedHookMsg {
Stake { addr: Addr, amount: Uint128 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -624,11 +624,14 @@ pub fn reply(

let mut mint_msgs: Vec<TokenMsg> = vec![];

// Check supply is greater than zero
// Check supply is greater than zero, iterate through initial
// balances and sum them.
let initial_supply = token
.initial_balances
.iter()
.fold(Uint128::zero(), |p, n| p + n.amount);
.fold(Uint128::zero(), |previous, new_balance| {
previous + new_balance.amount
});

// Cannot instantiate with no initial token owners because it would
// immediately lock the DAO.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use cosmwasm_schema::cw_serde;
use cosmwasm_std::{to_binary, Addr, StdResult, Storage, SubMsg, Uint128, WasmMsg};
use token_bindings::TokenFactoryMsg;

// This is just a helper to properly serialize the above message
#[cw_serde]
pub enum StakeChangedHookMsg {
Stake { addr: Addr, amount: Uint128 },
Expand Down

0 comments on commit 0a47b53

Please sign in to comment.