Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0xChqrles committed Oct 1, 2024
1 parent 777c587 commit e712e26
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 72 deletions.
8 changes: 6 additions & 2 deletions contracts/src/contracts/ramps/revolut/revolut.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,17 @@ pub mod RevolutRamp {
assert(liquidity_key.owner == caller, Errors::CALLER_IS_NOT_OWNER);

let token = self.token.read();
let available_amount = self._get_available_liquidity(:liquidity_key);

// update stored liquidity
let amount = self.liquidity.read(liquidity_key);
self.liquidity.write(liquidity_key, amount - available_amount);

// use the escrow to unlock the funds
self.escrow.unlock(from: caller, to: caller, :token, :amount);
self.escrow.unlock(from: caller, to: caller, :token, amount: available_amount);

// emits Liquidityretrieved event
self.emit(LiquidityRetrieved { liquidity_key, amount });
self.emit(LiquidityRetrieved { liquidity_key, amount: available_amount });
}

// If the requested amount is valid according to the available amount,
Expand Down
Loading

0 comments on commit e712e26

Please sign in to comment.