Skip to content

Commit 0884c69

Browse files
committed
Add chain wrapper when confirming transactions
1 parent 654a000 commit 0884c69

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

components/Bridge/v3/Steps/ConfirmNEVMTransaction.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { ITransferLog, TransferStatus } from "@contexts/Transfer/types";
22
import { useTransfer } from "../context/TransferContext";
3-
import { useWeb3 } from "../context/Web";
43
import { Alert, CircularProgress, Link, Typography } from "@mui/material";
54
import { useNevmTransaction } from "../hooks/useNevmTransaction";
65
import { useEffect } from "react";
76
import { NEVM_TX_BLOCKCHAIN_URL } from "@constants";
7+
import NEVMStepWrapper from "../NEVMStepWrapepr";
88

99
type Props = {
1010
successStatus: TransferStatus;
@@ -70,4 +70,10 @@ const BridgeV3ConfirmNEVMTransaction: React.FC<Props> = ({
7070
);
7171
};
7272

73-
export default BridgeV3ConfirmNEVMTransaction;
73+
const Wrapped: React.FC<Props> = (props) => (
74+
<NEVMStepWrapper>
75+
<BridgeV3ConfirmNEVMTransaction {...props} />
76+
</NEVMStepWrapper>
77+
);
78+
79+
export default Wrapped;

components/Bridge/v3/Steps/ConfirmUTXOTransaction.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import { Alert, Box, CircularProgress, Link } from "@mui/material";
22
import { useTransfer } from "../context/TransferContext";
33
import { useUtxoTransaction } from "components/Bridge/v3/hooks/useUtxoTransaction";
44
import { ITransferLog, TransferStatus } from "@contexts/Transfer/types";
5-
import { useEffect } from "react";
5+
import React, { useEffect } from "react";
66
import { SYSCOIN_TX_BLOCKCHAIN_URL } from "@constants";
7+
import UTXOStepWrapper from "../UTXOStepWrapper";
78

89
type Props = {
910
invalidStateMessage: string;
@@ -76,4 +77,10 @@ const BridgeV3StepConfirmUTXOTransaction: React.FC<Props> = ({
7677
);
7778
};
7879

79-
export default BridgeV3StepConfirmUTXOTransaction;
80+
const Wrapped: React.FC<Props> = (props) => (
81+
<UTXOStepWrapper>
82+
<BridgeV3StepConfirmUTXOTransaction {...props} />
83+
</UTXOStepWrapper>
84+
);
85+
86+
export default Wrapped;

components/Bridge/v3/hooks/useFreezeAndBurn.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useMutation } from "react-query";
44
import { SYSX_ASSET_GUID } from "@contexts/Transfer/constants";
55
import { toWei } from "web3-utils";
66
import { useErc20ManagerContract } from "./useErc20ManagerContract";
7+
import { DEFAULT_GAS_LIMIT } from "@constants";
78

89
export const useFreezeAndBurn = (transfer: ITransfer) => {
910
const erc20ManagerContract = useErc20ManagerContract();
@@ -21,6 +22,7 @@ export const useFreezeAndBurn = (transfer: ITransfer) => {
2122

2223
const gas = await method.estimateGas().catch((error: Error) => {
2324
console.error("Estimate gas error", error);
25+
return DEFAULT_GAS_LIMIT
2426
});
2527

2628
return new Promise<string>((resolve, reject) => {

0 commit comments

Comments
 (0)