Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
yuli-ferna committed Sep 10, 2024
1 parent 450679a commit 4a50f27
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion apps/connect/src/env/token-bridge.mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Env, MAINNET_RPCS } from "./common";
export const ENV: Env = {
...ENV_BASE,
wormholeConnectConfig: mergeDeep<WormholeConnectConfig>(
ENV_BASE.wormholeConnectConfig as WormholeConnectConfig,
ENV_BASE.wormholeConnectConfig,
{
rpcs: MAINNET_RPCS,
moreNetworks: {
Expand Down
2 changes: 1 addition & 1 deletion apps/connect/src/env/token-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const MORE = {
export const ENV: Env = {
PUBLIC_URL,
navBar: [
{ label: "Home", active: true, href: `${PUBLIC_URL}/` },
{ label: "Bridge", active: true, href: `${PUBLIC_URL}/` },
{
label: "Staking",
href: "https://www.tally.xyz/gov/wormhole",
Expand Down
2 changes: 1 addition & 1 deletion apps/connect/src/env/usdc-bridge.mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Env, MAINNET_RPCS } from "./common";
export const ENV: Env = {
...ENV_BASE,
wormholeConnectConfig: mergeDeep<WormholeConnectConfig>(
ENV_BASE.wormholeConnectConfig as WormholeConnectConfig,
ENV_BASE.wormholeConnectConfig,
{
rpcs: MAINNET_RPCS,
chains: [
Expand Down
2 changes: 1 addition & 1 deletion apps/connect/src/env/usdc-bridge.testnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Env } from "./common";
export const ENV: Env = {
...ENV_BASE,
wormholeConnectConfig: mergeDeep<WormholeConnectConfig>(
ENV_BASE.wormholeConnectConfig as WormholeConnectConfig,
ENV_BASE.wormholeConnectConfig,
{
chains: [
"Sepolia",
Expand Down
2 changes: 1 addition & 1 deletion apps/connect/src/env/usdc-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const ENV: Env = {
],
redirects: undefined,
wormholeConnectConfig: {
...(wormholeConnectConfigCommon as WormholeConnectConfig),
...wormholeConnectConfigCommon,
useRedesign: true,
pageHeader: {
text: "USDC Transfer",
Expand Down
4 changes: 2 additions & 2 deletions apps/connect/src/hooks/useConnectConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { validateTransfer } from "../utils/transferVerification";
import { getSortedChains } from "../utils/getSortedChains";

const defaultConfig: WormholeConnectConfig = {
...(ENV.wormholeConnectConfig as WormholeConnectConfig),
...ENV.wormholeConnectConfig,
eventHandler: (e: WormholeConnectEvent) => {
if (isPreview || isProduction) {
// Send the event to Mixpanel
Expand Down Expand Up @@ -70,7 +70,7 @@ export const useConnectConfig = () => {
useEffect(() => {
const controller = new AbortController();
getSortedChains(
(ENV.wormholeConnectConfig as WormholeConnectConfig).chains as Chain[],
ENV.wormholeConnectConfig.chains as Chain[],
controller.signal
).then((chains) => !!chains && setNetworks(chains));
return () => controller.abort();
Expand Down
2 changes: 1 addition & 1 deletion apps/connect/src/hooks/useFormatAssetParam.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe("useFormatAssetParam", () => {
});

it("should NOT get a formatted asset when key does NOT have an exact match", () => {
const { result } = renderHook(() => useFormatAssetParam("ETH"));
const { result } = renderHook(() => useFormatAssetParam("eth"));
expect(result.current).toEqual("ETH");
});

Expand Down
5 changes: 2 additions & 3 deletions apps/connect/src/hooks/useFormatAssetParam.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { ENV } from "@env";
import {
MAINNET,
TESTNET,
WormholeConnectConfig,
TESTNET
} from "@wormhole-foundation/wormhole-connect";
import { useMemo } from "react";

Expand All @@ -11,7 +10,7 @@ const tokensList =
function getFormatedAsset(asset: string | null): string | null {
const allTokens = {
...tokensList,
...(ENV.wormholeConnectConfig as WormholeConnectConfig)?.tokensConfig,
...(ENV.wormholeConnectConfig?.tokensConfig),
};
if (allTokens && asset) {
const tokenParam = Object.values(allTokens).find((config) =>
Expand Down
4 changes: 2 additions & 2 deletions apps/connect/src/hooks/useQueryParams.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe("useQueryParams", () => {

it("should get QS when query contains all expected attrs after a hash #", () => {
rewriteHref(
"https://portalbridge.com/#/?sourceChain=Bsc&targetChain=Arbitrum&requiredNetwork=Arbitrum&txHash=txHash&asset=asset&route=bridge"
"https://portalbridge.com/#/?sourceChain=bsc&targetChain=arbitrum&requiredNetwork=arbitrum&txHash=txHash&asset=asset&route=bridge"
);
const { result } = renderHook(() => useQueryParams());
expect(result.current).toEqual({
Expand All @@ -43,7 +43,7 @@ describe("useQueryParams", () => {

it("should get QS when query contains all expected attrs when there is no hash", () => {
rewriteHref(
"https://portalbridge.com/?sourceChain=Bsc&targetChain=Arbitrum&requiredNetwork=Arbitrum&txHash=txHash&asset=asset&route=bridge"
"https://portalbridge.com/?sourceChain=bsc&targetChain=arbitrum&requiredNetwork=arbitrum&txHash=txHash&asset=asset&route=bridge"
);
const { result } = renderHook(() => useQueryParams());
expect(result.current).toEqual({
Expand Down

0 comments on commit 4a50f27

Please sign in to comment.