Skip to content

Commit

Permalink
fix: remove validation for nibivaloper adresses
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasmatt committed Mar 7, 2024
1 parent 50a1130 commit 3209e9c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion artifacts/checksums.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
f684c6daf9e77d2f7cb14e70f87e6f10cd97cd02d163f71ab4e2f6f823abfc8a airdrop_token_vesting.wasm
382c05baf544f2886de849933ecf59e8bc3bcdcdd552d5a63537bd6d63f2ecf1 controller.wasm
23ab4cb147c10a0c5e1a3ba56b57d8616cab32b0a02ee3a7d74adde2f48e6a3d core_compounder.wasm
05948cad982935aa30a9c2011649ab40a38172ab50df5781a3e24f72b76dcc56 core_compounder.wasm
b56a880d4c67d9f353f549b502256f73159f89b50aa6dae683948e117efa4792 cw3_flex_multisig.wasm
1ecff403bbf3b5fcedccb5de76a0ef5f1fdbcc5f60890e3388f5425584899f0b incentives.wasm
dc89ed88f1c69bf63fc284492b7bf6935e3a85da2945067d70f71f08c01df60d lockup.wasm
Expand Down
Binary file modified artifacts/core_compounder.wasm
Binary file not shown.
10 changes: 7 additions & 3 deletions contracts/core-compounder/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,8 @@ pub fn stake(
}

let mut messages: Vec<CosmosMsg> = vec![];
let mut attrs: Vec<cosmwasm_std::Attribute> = vec![];
for stake_msg in stake_msgs.iter() {
let _ = deps.api.addr_validate(&stake_msg.validator)?;

let amount_to_delegate = amount * stake_msg.share / total_shares;
if amount_to_delegate.is_zero() {
continue;
Expand All @@ -201,12 +200,17 @@ pub fn stake(
amount_to_delegate,
stake_msg.validator.to_string(),
)?);
attrs.push(cosmwasm_std::Attribute {
key: "stake".to_string(),
value: format!("{}:{}", stake_msg.validator, amount_to_delegate),
});
}

Ok(Response::new()
.add_messages(messages)
.add_attribute("action", "stake")
.add_attribute("amount", amount))
.add_attribute("amount", amount)
.add_attributes(attrs))
}

///
Expand Down

0 comments on commit 3209e9c

Please sign in to comment.