Skip to content

Commit

Permalink
Merge pull request #33 from gateway-fm/test
Browse files Browse the repository at this point in the history
Test
  • Loading branch information
UrfinDeuce authored Jul 31, 2024
2 parents b0c34bd + 4c1405d commit 5ac9bc8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push-docker-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
with:
platforms: linux/amd64,linux/arm64
push: true
tags: gatewayfm/zkevm-bridge-ui-generic:1.0.0
tags: gatewayfm/zkevm-bridge-ui-generic:1.0.1
5 changes: 5 additions & 0 deletions src/adapters/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ interface Env {
VITE_FIAT_EXCHANGE_RATES_API_KEY?: string;
VITE_FIAT_EXCHANGE_RATES_API_URL?: string;
VITE_FIAT_EXCHANGE_RATES_ETHEREUM_USDC_ADDRESS?: string;
VITE_ICON_PATH?: string;
VITE_LOGO_PATH?: string;
VITE_NETWORK_NAME?: string;
VITE_NETWORK_SYMBOL?: string;
Expand Down Expand Up @@ -173,6 +174,7 @@ const envToDomain = ({
VITE_FIAT_EXCHANGE_RATES_API_KEY,
VITE_FIAT_EXCHANGE_RATES_API_URL,
VITE_FIAT_EXCHANGE_RATES_ETHEREUM_USDC_ADDRESS,
VITE_ICON_PATH,
VITE_LOGO_PATH,
VITE_NETWORK_NAME,
VITE_NETWORK_SYMBOL,
Expand All @@ -198,6 +200,7 @@ const envToDomain = ({
);
const bridgeApiUrl = VITE_BRIDGE_API_URL;
const logoPath = VITE_LOGO_PATH;
const iconPath = VITE_ICON_PATH ?? logoPath;
const faviconPath = VITE_FAVICON_PATH;
const networkName = VITE_NETWORK_NAME;
const networkSymbol = VITE_NETWORK_SYMBOL;
Expand Down Expand Up @@ -226,6 +229,7 @@ const envToDomain = ({
polygonZkEVM: {
bridgeContractAddress: VITE_POLYGON_ZK_EVM_BRIDGE_CONTRACT_ADDRESS,
explorerUrl: VITE_POLYGON_ZK_EVM_EXPLORER_URL,
iconUrl: iconPath,
networkId: polygonZkEVMNetworkId,
rpcUrl: VITE_POLYGON_ZK_EVM_RPC_URL,
},
Expand Down Expand Up @@ -282,6 +286,7 @@ const envParser = StrictSchema<Env, domain.Env>()(
VITE_FIAT_EXCHANGE_RATES_API_KEY: z.string().optional(),
VITE_FIAT_EXCHANGE_RATES_API_URL: z.string().url().optional(),
VITE_FIAT_EXCHANGE_RATES_ETHEREUM_USDC_ADDRESS: z.string().length(42).optional(),
VITE_ICON_PATH: z.string().optional(),
VITE_LOGO_PATH: z.string().optional(),
VITE_NETWORK_NAME: z.string().optional(),
VITE_NETWORK_SYMBOL: z.string().optional(),
Expand Down
8 changes: 8 additions & 0 deletions src/assets/network-icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const L2Icon = (url: string) => {
return () => {
return (
<img height={24} src={url} width={24}/>
)

}
}
8 changes: 3 additions & 5 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { StaticJsonRpcProvider } from "@ethersproject/providers";
import { ethers } from "ethers";

import { defaultAbiCoder } from "ethers/lib/utils";
import { L2Icon } from "./assets/network-icon";
import { ReactComponent as EthChainIcon } from "src/assets/icons/chains/ethereum.svg";
import { ReactComponent as PolygonZkEVMChainIcon } from "src/assets/icons/chains/polygon-zkevm.svg";
import { Chain, Currency, EthereumChain, ProviderError, Token, ZkEVMChain } from "src/domain";
Expand Down Expand Up @@ -93,6 +94,7 @@ export const getChains = ({
polygonZkEVM: {
bridgeContractAddress: string;
explorerUrl: string;
iconUrl?: string;
networkId: number;
rpcUrl: string;
};
Expand All @@ -107,10 +109,6 @@ export const getChains = ({
polygonZkEVM.bridgeContractAddress,
polygonZkEVMProvider
);
// const bridgeEthereumContract = Bridge__factory.connect(
// ethereum.bridgeContractAddress,
// ethereumProvider
// );

return Promise.all([
ethereumProvider.getNetwork().catch(() => Promise.reject(ProviderError.Ethereum)),
Expand Down Expand Up @@ -153,7 +151,7 @@ export const getChains = ({
bridgeContractAddress: polygonZkEVM.bridgeContractAddress,
chainId: polygonZkEVMNetwork.chainId,
explorerUrl: polygonZkEVM.explorerUrl,
Icon: PolygonZkEVMChainIcon,
Icon: polygonZkEVM.iconUrl ? L2Icon(polygonZkEVM.iconUrl) : PolygonZkEVMChainIcon,
key: "polygon-zkevm",
name: polygonZkEVMNetworkName,
nativeCurrency: {
Expand Down

0 comments on commit 5ac9bc8

Please sign in to comment.