-
-
Notifications
You must be signed in to change notification settings - Fork 649
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more coverage of tx history (#4060)
* add more coverage of tx history - still need to move this to to backend in the future * made tx labels/icons work with new schema meta type * working tx history with expanded tx types * added support for polygon bridge * added more protocol coverage * added ens domain renewal * fixed translation key test * added test for txHistory slice * preserve native txtypes * added some logging for debug * fixed tx derivation bug * fix most requested changes * finished requested changes * updated to production infra * added requested changes * fix test
- Loading branch information
Showing
28 changed files
with
664 additions
and
214 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
[ | ||
"1INCH", | ||
"1INCH_V3", | ||
"ERC20", | ||
"ERC_20", | ||
"GNOSIS_SAFE", | ||
"SPARKPOOL", | ||
"MININGPOOLHUB", | ||
"ETHERMINE", | ||
"AAVE", | ||
"COMPOUND", | ||
"UNISWAP_V1", | ||
"UNISWAP_V2", | ||
"UNISWAP_V3", | ||
"PARASWAP", | ||
"KYBER", | ||
"REP", | ||
"ONE_INCH_EXCHANGE", | ||
"DEX_AG", | ||
"IDEX", | ||
"POLYGON", | ||
"0X", | ||
"0X_V3", | ||
"BALANCER", | ||
"ENS", | ||
"METAMASK_V1", | ||
"OPENSEA", | ||
"PARASWAP_V4", | ||
"POOLTOGETHER", | ||
"SUSHISWAP", | ||
"TORNADO_CASH_V1", | ||
"CURVE_V1", | ||
"CURVE_V2", | ||
"MAKER_V2", | ||
"YEARN_V2", | ||
"SYNTHETIX", | ||
"RARIBLE", | ||
"AXIE_INFINITY", | ||
"LIDO", | ||
"PLATFORM_CLAIM", | ||
"PLATFORM_MIGRATED", | ||
"PLATFORM_DOMAIN_REGISTER", | ||
"PLATFORM_DOMAIN_TRANSFER", | ||
"PLATFORM_DOMAIN_RENEW", | ||
"PLATFORM_CANCEL_ORDER", | ||
"PLATFORM_REGISTER", | ||
"PLATFORM_APPROVE", | ||
"PLATFORM_APPROVAL", | ||
"PLATFORM_MULTISIG_APPROVE_TX", | ||
"PLATFORM_DEPOSIT_ETH", | ||
"PLATFORM_DEPOSIT_TOKEN", | ||
"PLATFORM_MINING_PAYOUT", | ||
"PLATFORM_MINT", | ||
"PLATFORM_ROUTER_TO", | ||
"PLATFORM_SWAP", | ||
"PLATFORM_TRANSFER", | ||
"PLATFORM_UNWRAP", | ||
"PLATFORM_WRAP", | ||
"PLATFORM_DEPOSIT", | ||
"PLATFORM_WITHDRAW", | ||
"PLATFORM_EXCHANGE", | ||
"PLATFORM_BORROW", | ||
"PLATFORM_REPAY", | ||
"PLATFORM_MIGRATION", | ||
"PLATFORM_BRIDGE_IN", | ||
"PLATFROM_BRIDGE_OUT" | ||
] |
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
45 changes: 45 additions & 0 deletions
45
src/features/Dashboard/components/RecentTransactionList.test.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { DeepPartial } from '@reduxjs/toolkit'; | ||
import { mockStore, simpleRender } from 'test-utils'; | ||
|
||
import { fAccounts, fTxHistoryAPI, fTxTypeMetas } from '@fixtures'; | ||
import { ITxHistoryApiResponse } from '@services/ApiService/History'; | ||
import { translateRaw } from '@translations'; | ||
|
||
import RecentTransactionList from './RecentTransactionList'; | ||
|
||
/* Test components */ | ||
describe('RecentTransactionList', () => { | ||
const renderComponent = () => { | ||
return simpleRender(<RecentTransactionList accountsList={fAccounts} />, { | ||
initialState: mockStore({ | ||
storeSlice: { | ||
txHistory: { | ||
history: [fTxHistoryAPI as unknown as DeepPartial<ITxHistoryApiResponse>], | ||
txTypeMeta: fTxTypeMetas | ||
} | ||
} | ||
}) | ||
}) | ||
}; | ||
|
||
test('Can render', () => { | ||
const { getByText } = renderComponent(); | ||
const selector = translateRaw('RECENT_TRANSACTIONS'); | ||
expect(getByText(selector)).toBeInTheDocument(); | ||
}); | ||
|
||
test('Can render transactions', () => { | ||
const { getByText } = renderComponent(); | ||
const selector = translateRaw('RECENT_TRANSACTIONS_DATE') | ||
expect(getByText(selector)).toBeInTheDocument(); | ||
}); | ||
|
||
test('Can properly interpret tx complex tx type', () => { | ||
const { getByText } = renderComponent(); | ||
const selector = translateRaw('RECENT_TX_LIST_PLATFORM_INTERACTION', { | ||
$platform: translateRaw('UNISWAP_V2'), | ||
$action: translateRaw('PLATFORM_EXCHANGE') | ||
}); | ||
expect(getByText(selector)).toBeInTheDocument(); | ||
}); | ||
}); |
Oops, something went wrong.