Skip to content

Commit

Permalink
do not care
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitry-lahoda committed Nov 22, 2023
1 parent 09ca56b commit 416d595
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions contracts/cosmwasm/order/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ pub struct OrderItem {

impl OrderItem {
pub fn fill(&mut self, wanted_transfer: Uint128) {
// was given more or exact wanted - user happy
// was given more or exact wanted - user happy or user was given all before, do not give more
if wanted_transfer >= self.msg.wants.amount || self.msg.wants.amount.u128() == <_>::default() {
self.given.amount = <_>::default();
self.msg.wants.amount = <_>::default();
} else {
self.msg.wants.amount = self.msg.wants.amount.checked_sub(wanted_transfer).expect("proven above via comparison");
let given_reduction = wanted_transfer * self.given.amount / self.msg.wants.amount;

self.given.amount = self.given.amount.checked_sub(given_reduction).expect("proven above via ratio");
self.given.amount = self.given.amount.saturating_sub(given_reduction);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion mainnet.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
RUST_BACKTRACE=1 RUST_TRACE=trace cargo run --bin mantis -- --rpc-centauri "https://composable-rpc.polkachu.com:443" --grpc-centauri "https://composable-grpc.polkachu.com:22290" --osmosis "todo" --neutron "todo" --cvm-contract "centauri1wpf2szs4uazej8pe7g8vlck34u24cvxx7ys0esfq6tuw8yxygzuqpjsn0d" --wallet "$WALLET" --order-contract "centauri1a2jkcrgrrk5te4uwz4derw5704sj5pvnfencgy7f0y3uc7kugrzsxf9dfd" --simulate "200000ppica,3ibc/EF48E6B1A1A19F47ECAEA62F5670C37C0580E86A9E88498B7E393EB6F49F33C0"
RUST_BACKTRACE=1 RUST_TRACE=trace cargo run --bin mantis -- --rpc-centauri "https://composable-rpc.polkachu.com:443" --grpc-centauri "https://composable-grpc.polkachu.com:22290" --osmosis "todo" --neutron "todo" --cvm-contract "centauri1wpf2szs4uazej8pe7g8vlck34u24cvxx7ys0esfq6tuw8yxygzuqpjsn0d" --wallet "$WALLET" --order-contract "centauri1qxs8gwpv6kks2ypxxd4s0730qh6y0h006xe3ldtprjxny5hlr4pqm28m23" --simulate "200000ppica,3ibc/EF48E6B1A1A19F47ECAEA62F5670C37C0580E86A9E88498B7E393EB6F49F33C0"

0 comments on commit 416d595

Please sign in to comment.