Skip to content

Commit

Permalink
fix: show failed simulations correctly (#2308)
Browse files Browse the repository at this point in the history
  • Loading branch information
schmanu authored Jul 26, 2023
1 parent fbd7b52 commit bc8a9ba
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/components/tx/security/tenderly/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const TxSimulationBlock = ({ transactions, disabled, gasLimit }: TxSimulationPro
const { safeTx } = useContext(SafeTxContext)
const {
simulation: { simulateTransaction, resetSimulation },
status: { isError, isSuccess, isCallTraceError, isLoading },
status: { isFinished, isError, isSuccess, isCallTraceError, isLoading },
} = useContext(TxInfoContext)

const handleSimulation = async () => {
Expand Down Expand Up @@ -99,16 +99,18 @@ const TxSimulationBlock = ({ transactions, disabled, gasLimit }: TxSimulationPro
color: ({ palette }) => palette.text.secondary,
}}
/>
) : isError || isCallTraceError ? (
<Typography variant="body2" color="error.main" className={sharedCss.result}>
<SvgIcon component={CloseIcon} inheritViewBox fontSize="small" sx={{ verticalAlign: 'middle', mr: 1 }} />
Error
</Typography>
) : isSuccess ? (
<Typography variant="body2" color="success.main" className={sharedCss.result}>
<SvgIcon component={CheckIcon} inheritViewBox fontSize="small" sx={{ verticalAlign: 'middle', mr: 1 }} />
Success
</Typography>
) : isFinished ? (
!isSuccess || isError || isCallTraceError ? (
<Typography variant="body2" color="error.main" className={sharedCss.result}>
<SvgIcon component={CloseIcon} inheritViewBox fontSize="small" sx={{ verticalAlign: 'middle', mr: 1 }} />
Error
</Typography>
) : (
<Typography variant="body2" color="success.main" className={sharedCss.result}>
<SvgIcon component={CheckIcon} inheritViewBox fontSize="small" sx={{ verticalAlign: 'middle', mr: 1 }} />
Success
</Typography>
)
) : (
<Button
variant="outlined"
Expand Down

0 comments on commit bc8a9ba

Please sign in to comment.