From 12376327b156e125809ba0eb5f6e9884ae180ad4 Mon Sep 17 00:00:00 2001 From: Julian Konchunas Date: Wed, 23 Jun 2021 12:36:01 +0300 Subject: [PATCH] Remove unused lambda match params --- contracts/partials/TTMethodDex.ligo | 24 ++++++++++++------------ contracts/partials/TTMethodFA2.ligo | 12 ++++-------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/contracts/partials/TTMethodDex.ligo b/contracts/partials/TTMethodDex.ligo index 2db8e171..e07c0e84 100644 --- a/contracts/partials/TTMethodDex.ligo +++ b/contracts/partials/TTMethodDex.ligo @@ -269,9 +269,9 @@ function initialize_exchange( params.pair.token_b_type ) # operations; } - | Swap(n) -> skip - | Invest(n) -> skip - | Divest(n) -> skip + | Swap(_) -> skip + | Invest(_) -> skip + | Divest(_) -> skip end } with (operations, s) @@ -350,7 +350,7 @@ function token_to_token_route( block { var operations: list(operation) := list[]; case p of - | AddPair(n) -> skip + | AddPair(_) -> skip | Swap(params) -> { if s.entered then failwith("Dex/reentrancy") @@ -431,8 +431,8 @@ function token_to_token_route( end; operations := last_operation # operations; } - | Invest(n) -> skip - | Divest(n) -> skip + | Invest(_) -> skip + | Divest(_) -> skip end } with (operations, s) @@ -445,8 +445,8 @@ function invest_liquidity( block { var operations: list(operation) := list[]; case p of - | AddPair(n) -> skip - | Swap(n) -> skip + | AddPair(_) -> skip + | Swap(_) -> skip | Invest(params) -> { if s.entered then failwith("Dex/reentrancy") @@ -539,7 +539,7 @@ function invest_liquidity( params.pair.token_b_type ) # operations; } - | Divest(n) -> skip + | Divest(_) -> skip end } with (operations, s) @@ -551,9 +551,9 @@ function divest_liquidity( block { var operations: list(operation) := list[]; case p of - | AddPair(token_amount) -> skip - | Swap(n) -> skip - | Invest(n) -> skip + | AddPair(_) -> skip + | Swap(_) -> skip + | Invest(_) -> skip | Divest(params) -> { if s.entered then failwith("Dex/reentrancy") diff --git a/contracts/partials/TTMethodFA2.ligo b/contracts/partials/TTMethodFA2.ligo index f497f600..50f780fd 100644 --- a/contracts/partials/TTMethodFA2.ligo +++ b/contracts/partials/TTMethodFA2.ligo @@ -1,7 +1,3 @@ -(* Helper function to get allowance for an account *) -function get_allowance (const owner_account : account_info; const spender : address; const s : dex_storage) : bool is - owner_account.allowances contains spender - (* Perform transfers from one owner *) [@inline] function iterate_transfer (const s : dex_storage; const user_trx_params : transfer_param) : dex_storage is block { @@ -84,8 +80,8 @@ function transfer (const p : token_action; var s : dex_storage; const this : add | ITransfer(params) -> { s := List.fold(iterate_transfer, params, s); } - | IBalance_of(params) -> skip - | IUpdate_operators(params) -> skip + | IBalance_of(_) -> skip + | IUpdate_operators(_) -> skip end } with (operations, s) @@ -93,7 +89,7 @@ function get_balance_of (const p : token_action; const s : dex_storage; const th block { var operations: list(operation) := list[]; case p of - | ITransfer(params) -> skip + | ITransfer(_) -> skip | IBalance_of(balance_params) -> { (* Perform single balance lookup *) function look_up_balance(const l: list (balance_of_response); const request : balance_of_request) : list (balance_of_response) is @@ -112,7 +108,7 @@ function get_balance_of (const p : token_action; const s : dex_storage; const th const accumulated_response : list (balance_of_response) = List.fold(look_up_balance, balance_params.requests, (nil: list(balance_of_response))); operations := list[Tezos.transaction(accumulated_response, 0mutez, balance_params.callback)]; } - | IUpdate_operators(params) -> skip + | IUpdate_operators(_) -> skip end } with (operations, s)