Skip to content

Commit

Permalink
refactor(profit): Renamed parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
KirilMihaylov committed Jun 7, 2023
1 parent 3f23266 commit 1947fb0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions contracts/profit/src/profit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ pub struct Profit;

impl Profit {
pub(crate) fn transfer_nls<B>(
mut account: B,
treasury_addr: &Addr,
balance_nls: Coin<Nls>,
mut from_my_account: B,
to_treasury: &Addr,
amount: Coin<Nls>,
env: &Env,
) -> PlatformResponse
where
B: BankAccount,
{
if balance_nls.is_zero() {
PlatformResponse::messages_only(account.into())
if amount.is_zero() {
PlatformResponse::messages_only(from_my_account.into())
} else {
account.send(balance_nls, treasury_addr);
from_my_account.send(amount, to_treasury);

PlatformResponse::messages_with_events(
account.into(),
from_my_account.into(),
Emitter::of_type("tr-profit")
.emit_tx_info(env)
.emit_coin("profit-amount", balance_nls),
.emit_coin("profit-amount", amount),
)
}
}
Expand Down

0 comments on commit 1947fb0

Please sign in to comment.