Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
There are now kangaroos in the code.
Browse files Browse the repository at this point in the history
  • Loading branch information
bleaker0x committed Jan 23, 2022
1 parent df5d0aa commit 39890f0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/bridge/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -880,27 +880,27 @@ export namespace Bridge {

const
swapparoo = (t: Token, check: Token, swappy: Token): Token => t.isEqual(check) ? swappy : t,
swappadoo = (check: Token, swappy: Token): ((t: Token) => Token) => (t: Token) => swapparoo(t, check, swappy)
swappadoo = (check: Token, swappy: Token): ((t1: Token, t2: Token) => [Token, Token]) =>
(t1: Token, t2: Token) => [swapparoo(t1, check, swappy), swapparoo(t2, check, swappy)];

let kangaroo: (t1: Token, t2: Token) => [Token, Token];

let kangaroo: (t: Token) => Token;
switch (tokenFrom.swapType) {
case SwapType.ETH:
kangaroo = swappadoo(Tokens.ETH, Tokens.WETH);
[tokenFrom, tokenTo] = [kangaroo(tokenFrom), kangaroo(tokenTo)];

break;
case SwapType.AVAX:
kangaroo = swappadoo(Tokens.AVAX, Tokens.WAVAX);
[tokenFrom, tokenTo] = [kangaroo(tokenFrom), kangaroo(tokenTo)];

break;
case SwapType.MOVR:
kangaroo = swappadoo(Tokens.MOVR, Tokens.WMOVR);
[tokenFrom, tokenTo] = [kangaroo(tokenFrom), kangaroo(tokenTo)];

break;
default:
kangaroo = (t1: Token, t2: Token) => [t1, t2];
}

[tokenFrom, tokenTo] = kangaroo(tokenFrom, tokenTo);

const findSymbol = (tokA: Token, tokB: Token): boolean => {
let compareTok: Token = tokB;

Expand Down

0 comments on commit 39890f0

Please sign in to comment.