Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yuli-ferna committed Apr 10, 2024
1 parent 065e537 commit 28fccba
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
28 changes: 16 additions & 12 deletions src/components/Attest/Target.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import ButtonWithLoader from "../ButtonWithLoader";
import ChainSelect from "../ChainSelect";
import KeyAndBalance from "../KeyAndBalance";
import LowBalanceWarning from "../LowBalanceWarning";
import { isCosmosChain } from "../../utils/cosmos";

const useStyles = makeStyles((theme) => ({
alert: {
Expand Down Expand Up @@ -56,18 +57,21 @@ function Target() {
chains={chains}
/>
<KeyAndBalance chainId={targetChain} />
<Alert severity="info" variant="outlined" className={classes.alert}>
<Typography>
You will have to pay transaction fees on{" "}
{CHAINS_BY_ID[targetChain].name} to attest this token.{" "}
</Typography>
{isEVMChain(targetChain) && (
<GasEstimateSummary
methodType="createWrapped"
chainId={targetChain}
/>
)}
</Alert>
{/* In the case of cosmos chain target no fees are required */}
{!isCosmosChain(targetChain) && (
<Alert severity="info" variant="outlined" className={classes.alert}>
<Typography>
You will have to pay transaction fees on{" "}
{CHAINS_BY_ID[targetChain].name} to attest this token.{" "}
</Typography>
{isEVMChain(targetChain) && (
<GasEstimateSummary
methodType="createWrapped"
chainId={targetChain}
/>
)}
</Alert>
)}
<LowBalanceWarning chainId={targetChain} />
<ButtonWithLoader
disabled={!isTargetComplete}
Expand Down
2 changes: 0 additions & 2 deletions src/components/Attest/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ function Attest() {
{activeStep === 2 ? <Send /> : <SendPreview />}
</StepContent>
</Step>
{/* ONLY FOR TEST */}
{/* <Step expanded={activeStep >= 2}> */}
<Step expanded={activeStep >= 3}>
<StepButton
onClick={() => dispatch(setStep(3))}
Expand Down
14 changes: 7 additions & 7 deletions src/hooks/useHandleCreateWrapped.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -691,31 +691,31 @@ async function cosmos(
) {
dispatch(setIsCreating(true));
let tries = 0;
let messageShow = false;
const interval = setInterval(async () => {
try {
if (tries <= 5) {
tries++;
// ONLY FOR TEST
// const txs = await queryWormchain('85VBFQZC9TZkfaptBWjvUw7YbZjy52A6mjtPGjstQAmQ', CHAIN_ID_SOLANA);
const txs = await queryWormchain(sourceChainAddress, sourceChain);
console.log("txs", txs);
if (txs.length === 0) {
return null;
}
if (txs.length > 1) {
throw new Error("Multiple transactions found");
}

clearInterval(interval);
dispatch(
setCreateTx({
id: txs[0].hash,
block: txs[0].height,
})
);
enqueueSnackbar(null, {
content: <Alert severity="success">Transaction confirmed</Alert>,
});
if (!messageShow) {
messageShow = true;
enqueueSnackbar(null, {
content: <Alert severity="success">Transaction confirmed</Alert>,
});
}
} else {
clearInterval(interval);
dispatch(setIsCreating(false));
Expand Down

0 comments on commit 28fccba

Please sign in to comment.