Skip to content

Commit

Permalink
fix: lint and unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
micaelae committed Mar 7, 2025
1 parent 5becba9 commit d3dcef7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion shared/types/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export type BridgeToken = {
balance: string; // raw balance
string: string | undefined; // normalized balance as a stringified number
tokenFiatAmount?: number | null;
} | null;
};
// Types copied from Metabridge API

export enum BridgeFlag {
Expand Down
7 changes: 6 additions & 1 deletion ui/ducks/bridge/bridge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ describe('Ducks - Bridge', () => {
expect(actions[0].type).toStrictEqual('bridge/setToToken');
const newState = bridgeReducer(state, actions[0]);
expect(newState.toToken).toStrictEqual(
expect.objectContaining({ ...actionPayload, chainId: 'eip155:10' }),
expect.objectContaining({
...actionPayload,
balance: '0',
chainId: '0xa',
string: '0',
}),
);
});
});
Expand Down
7 changes: 2 additions & 5 deletions ui/hooks/bridge/useTokensWithFiltering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
type BridgeAppState,
getTopAssetsFromFeatureFlags,
} from '../../ducks/bridge/selectors';
import { type BridgeToken } from '../../../shared/types/bridge';

type FilterPredicate = (
symbol: string,
Expand All @@ -59,11 +60,7 @@ type FilterPredicate = (
*/
export const useTokensWithFiltering = (
chainId?: ChainId | Hex | CaipChainId,
tokenToExclude?: null | {
symbol: string;
address?: string;
chainId?: string;
},
tokenToExclude?: null | Pick<BridgeToken, 'symbol' | 'address' | 'chainId'>,
) => {
const allDetectedTokens: Record<string, Token[]> = useSelector(
getAllDetectedTokensForSelectedAddress,
Expand Down

0 comments on commit d3dcef7

Please sign in to comment.