-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(release): merge pull request #5270 from cowprotocol/release/202…
…5-01-07 * fix: adjust cow amm banner position (#5205) * feat: use new uni and coingecko token lists (#5225) * feat: use new uni and coingecko token lists * fix: linter errors * fix(limit-orders): do not override user entered price (#5232) * fix: allow any safe-like apps (#5235) * fix(feature-flags): remove isBaseEnabled feature flag (#5234) * feat(wallets): reapply "feat(wallets): add metaMask SDK connector (#5028)" (#5215) (#5223) * Reapply "feat(wallets): add metaMask SDK connector (#5028)" (#5215) This reverts commit 889b78e. * chore: update MetaMask SDK to 0.31.4 --------- Co-authored-by: Leandro <[email protected]> * chore: merge main to dev (#5238) * fix: allow any safe-like apps * chore: release main (#5237) * feat: fix pagination for fills (#5228) * feat: fix pagination for fills * fix: remove unnecessary tag --------- Co-authored-by: Alexandr Kazachenko <[email protected]> * feat(token-lists): remove outdated token lists (#5233) * feat: remove outdated token lists * feat: add curve's list to base * feat: add superchain list to base * chore: fix failed e2e test (#5257) * chore: address pr5244 comments (#5263) * fix: use network instead of orderParams chainId * refactor: update comment * ci: deploy some apps preview only when PR has label (#5258) * feat: executedSurplusFee removal (#5262) * chore: bump cow-sdk to latest RC version * feat: replace executedSurplusFee with executedSuplus Also use totalFee where applicable * feat: do same as previous, but on Explorer * refactor: moved getFeeToken out and improved logic as suggested * test: add unit tests * chore: comment out seasonal feature flags (#5271) * feat(swap): partial approve (#5256) * feat(swap): add settings option for partial approve * feat(swap): add sell amount to regular approve tx * feat(swap): add sell amount to permit value * chore: fix build * fix: cache permit taking amount into account * feat(swap): take partial approves into account for sc wallets * fix: ignore account agnostic permit in hooks details * fix: take permit amount into account when caching * fix: skip partial permits in widgets besides swap * chore: fix permit hook description * chore: fix conditions * fix: disable partial approve for Hooks store * fix: support partial approve it classic eth flow * fix: do not use infinite approvals in swap when partial approve mode * chore: fix circular dependency * chore: add a dot * chore: fix tooltips * chore: adjust approve tooltip * fix: display hook details only in Hooks store confirm modal * feat(partial-approvals): partial approve v2 (#5269) * refactor: expose UndelinedLinkStyledButton component * chore: removed unused React import * refactor: export useOpenSettingsTab hook * feat: expose needsApproval flag for all token types, not just permittable * feat: add PartialApprovalBanner * feat: update settings name Partial Approve to Minimal approve and tooltip * fix: fix typo and padding on settings link * fix: reworked minimal approvals title and tooltip * fix: lint issues * fix: cosmos build * fix: fix grammar * fix: do not show approval banner when selling native * chore: move partial approval banner after TWAP warning * feat: simplify text * feat: remove isApprovalNeeded prop * feat: remove banner from swap warnings * feat: add banner to top of Swap widget * chore: remove settings from cosmos --------- Co-authored-by: Leandro <[email protected]> --------- Co-authored-by: fairlight <[email protected]> Co-authored-by: Anxo Rodriguez <[email protected]> Co-authored-by: Alexandr Kazachenko <[email protected]> Co-authored-by: Edouard Bougon <[email protected]>
- Loading branch information
Showing
35 changed files
with
977 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 8 additions & 7 deletions
15
apps/cowswap-frontend/src/modules/ordersTable/pure/ReceiptModal/FeeField.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
apps/cowswap-frontend/src/modules/ordersTable/utils/getFeeToken.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { getFeeToken } from './getFeeToken' // Adjust the import path as necessary | ||
|
||
import { ordersMock } from '../pure/OrdersTableContainer/orders.mock' | ||
|
||
const BASE_ORDER = ordersMock[3] | ||
|
||
describe('getFeeToken', () => { | ||
it("should return inputToken when that's the fee token", () => { | ||
const input = BASE_ORDER | ||
const expectedOutput = BASE_ORDER.inputToken | ||
|
||
const result = getFeeToken(input) | ||
|
||
expect(result).toEqual(expectedOutput) | ||
}) | ||
|
||
it("should return outputToken when that's the fee token", () => { | ||
const input = { | ||
...BASE_ORDER, | ||
executionData: { ...BASE_ORDER.executionData, executedFeeToken: BASE_ORDER.outputToken.address }, | ||
} | ||
const expectedOutput = BASE_ORDER.outputToken | ||
|
||
const result = getFeeToken(input) | ||
|
||
expect(result).toEqual(expectedOutput) | ||
}) | ||
|
||
it('should return inputToken when there is no fee token', () => { | ||
const input = { ...BASE_ORDER, executionData: { ...BASE_ORDER.executionData, executedFeeToken: null } } | ||
const expectedOutput = BASE_ORDER.inputToken | ||
|
||
const result = getFeeToken(input) | ||
|
||
expect(result).toEqual(expectedOutput) | ||
}) | ||
}) |
14 changes: 14 additions & 0 deletions
14
apps/cowswap-frontend/src/modules/ordersTable/utils/getFeeToken.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { ParsedOrder } from 'utils/orderUtils/parseOrder' | ||
|
||
export function getFeeToken(order: ParsedOrder) { | ||
const { inputToken, outputToken } = order | ||
const { executedFeeToken } = order.executionData | ||
|
||
const feeTokenAddress = executedFeeToken?.toLowerCase() | ||
|
||
if (!feeTokenAddress) { | ||
return inputToken | ||
} | ||
|
||
return [inputToken, outputToken].find((token) => token?.address.toLowerCase() === feeTokenAddress) | ||
} |
Oops, something went wrong.