Skip to content

Commit

Permalink
verify cap call removed
Browse files Browse the repository at this point in the history
  • Loading branch information
tsilva-figure committed Jul 27, 2022
1 parent e10239a commit 57c39f9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ pub fn try_claim_investment(
due_epoch_seconds: None,
})
.ok_or("no capital call for subscription")?;
outstanding_capital_calls(deps.storage).save(&calls)?;

if let Some(due) = call.due_epoch_seconds {
if due < env.block.time.seconds() {
Expand Down Expand Up @@ -159,6 +160,7 @@ mod tests {
use crate::msg::CapitalCall;
use crate::msg::HandleMsg;
use crate::state::outstanding_capital_calls;
use crate::state::outstanding_capital_calls_read;
use crate::state::tests::set_accepted;
use crate::state::tests::to_addresses;
use cosmwasm_std::coin;
Expand Down Expand Up @@ -402,6 +404,15 @@ mod tests {
assert_eq!(1, coins.len());
assert_eq!("commitment_coin", coin.denom);
assert_eq!(100, coin.amount.u128());

// verify issued call removed
assert_eq!(
0,
outstanding_capital_calls_read(&deps.storage)
.load()
.unwrap()
.len()
);
}

#[test]
Expand Down

0 comments on commit 57c39f9

Please sign in to comment.