Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linting errors, add TODOs for failing tx flows #2070

Merged
merged 1 commit into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ const ReviewSafeAppsSignMessage = ({
}
}

// TODO: Need to use the SafeTxProvider here
return (
<SignOrExecuteForm safeTx={safeTx} onSubmit={handleSubmit} error={safeTxError || submitError}>
<SignOrExecuteForm onSubmit={handleSubmit}>
<>
<SendFromBlock />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ const ReviewSafeAppsTx = ({

const origin = useMemo(() => getTxOrigin(app), [app])

// TODO: Need to use the SafeTxProvider here
return (
<SignOrExecuteForm safeTx={safeTx} onSubmit={handleSubmit} error={safeTxError || submitError} origin={origin}>
<SignOrExecuteForm onSubmit={handleSubmit} origin={origin}>
<>
<ErrorBoundary fallback={<div>Error parsing data</div>}>
<ApprovalEditor txs={txList} updateTxs={setTxList} />
Expand Down
3 changes: 2 additions & 1 deletion src/components/settings/ContractVersion/UpdateSafeDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ const ReviewUpdateSafeStep = ({ onSubmit }: { onSubmit: () => void }) => {
return createMultiSendCallOnlyTx(txs)
}, [chain, safe, safeLoaded])

// TODO: Need to use the SafeTxProvider here
return (
<SignOrExecuteForm safeTx={safeTx} onSubmit={onSubmit} error={safeTxError}>
<SignOrExecuteForm onSubmit={onSubmit}>
<Typography mb={2}>
Update now to take advantage of new features and the highest security standards available.
</Typography>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ export const ReviewRemoveModule = ({ data, onSubmit }: { data: RemoveModuleData;
onSubmit()
}

// TODO: Need to use the SafeTxProvider here
return (
<SignOrExecuteForm safeTx={safeTx} onSubmit={onFormSubmit} error={safeTxError}>
<SignOrExecuteForm onSubmit={onFormSubmit}>
<SendToBlock address={data.address} title="Module" />
<Typography my={2}>
After removing this module, any feature or app that uses this module might no longer work. If this Safe Account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ export const ReviewSpendingLimit = ({ data, onSubmit }: Props) => {
onSubmit()
}

// TODO: Need to use the SafeTxProvider here
return (
<SignOrExecuteForm safeTx={safeTx} onSubmit={onFormSubmit} error={safeTxError}>
<SignOrExecuteForm onSubmit={onFormSubmit}>
{token && (
<TokenTransferReview amount={data.amount} tokenInfo={token.tokenInfo}>
{!!existingSpendingLimit && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ export const RemoveSpendingLimit = ({ data, onSubmit }: { data: SpendingLimitSta
onSubmit()
}

// TODO: Need to use the SafeTxProvider here
return (
<SignOrExecuteForm safeTx={safeTx} onSubmit={onFormSubmit} error={safeTxError}>
<SignOrExecuteForm onSubmit={onFormSubmit}>
{token && (
<TokenTransferReview
amount={safeFormatUnits(data.amount, token.tokenInfo.decimals)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ export const ReviewRemoveGuard = ({ data, onSubmit }: { data: RemoveGuardData; o
onSubmit()
}

// TODO: Need to use the SafeTxProvider here
return (
<SignOrExecuteForm safeTx={safeTx} onSubmit={onFormSubmit} error={safeTxError}>
<SignOrExecuteForm onSubmit={onFormSubmit}>
<Typography sx={({ palette }) => ({ color: palette.primary.light })}>Transaction guard</Typography>
<EthHashInfo address={data.address} showCopyButton hasExplorer shortAddress={false} />
<Typography my={2}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ export const ReviewOwnerTxStep = ({ data, onSubmit }: { data: ChangeOwnerData; o
onSubmit()
}

// TODO: Need to use the SafeTxProvider here
return (
<SignOrExecuteForm safeTx={safeTx} onSubmit={addAddressBookEntryAndSubmit} error={safeTxError}>
<SignOrExecuteForm onSubmit={addAddressBookEntryAndSubmit}>
<Grid
container
mt={-3}
Expand Down
8 changes: 2 additions & 6 deletions src/components/settings/owner/ChangeThresholdDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,8 @@ const ChangeThresholdStep = ({ data, onSubmit }: { data: ChangeThresholdData; on
</DialogContent>

<Box mt={-5}>
<SignOrExecuteForm
safeTx={safeTx}
onSubmit={onChangeThreshold}
error={safeTxError}
disableSubmit={isSameThreshold}
/>
{/* TODO: Need to use the SafeTxProvider here */}
<SignOrExecuteForm onSubmit={onChangeThreshold} disableSubmit={isSameThreshold} />
</Box>
</>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ export const ReviewRemoveOwnerTxStep = ({ data, onSubmit }: { data: RemoveOwnerD
onSubmit()
}

// TODO: Need to use the SafeTxProvider here
return (
<SignOrExecuteForm safeTx={safeTx} onSubmit={onFormSubmit} error={safeTxError}>
<SignOrExecuteForm onSubmit={onFormSubmit}>
<Grid
container
mt={-3}
Expand Down
3 changes: 2 additions & 1 deletion src/components/tx/modals/NftBatchModal/ReviewNftBatch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ const ReviewNftBatch = ({ params, onSubmit }: ReviewNftBatchProps): ReactElement
return calls.length > 1 ? createMultiSendCallOnlyTx(calls) : createTx(calls[0])
}, [safeAddress, params])

// TODO: Need to use the SafeTxProvider here
return (
<SignOrExecuteForm safeTx={safeTx} onSubmit={onSubmit} error={safeTxError}>
<SignOrExecuteForm onSubmit={onSubmit}>
<SendFromBlock title={`Sending ${tokens.length} NFT${tokens.length > 1 ? 's' : ''} from`} />

<SendToBlock address={params.recipient} title="To" />
Expand Down
3 changes: 2 additions & 1 deletion src/components/tx/modals/RejectTxModal/RejectTx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ const RejectTx = ({ txNonce, onSubmit }: RejectTxProps): ReactElement => {
return createRejectTx(txNonce)
}, [txNonce])

// TODO: Need to use the SafeTxProvider here
return (
<SignOrExecuteForm safeTx={rejectTx} isRejection onSubmit={onSubmit} error={rejectError}>
<SignOrExecuteForm isRejection onSubmit={onSubmit}>
<Typography mb={2}>
To reject the transaction, a separate rejection transaction will be created to replace the original one.
</Typography>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ const ReviewMultisigTx = ({ params, onSubmit }: TokenTransferModalProps): ReactE
return createTx(txParams, params.txNonce)
}, [params, decimals, address])

// TODO: Need to use the SafeTxProvider here
return (
<SignOrExecuteForm safeTx={safeTx} onSubmit={onSubmit} error={safeTxError}>
<SignOrExecuteForm onSubmit={onSubmit}>
{token && <TokenTransferReview amount={params.amount} tokenInfo={token.tokenInfo} />}

<SendFromBlock />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,7 @@ const ReviewSpendingLimitTx = ({ params, onSubmit }: TokenTransferModalProps): R

<SendToBlock address={params.recipient} />

<AdvancedParams
params={advancedParams}
willExecute={true}
nonceReadonly={false}
onFormSubmit={setManualParams}
/>
<AdvancedParams params={advancedParams} willExecute={true} onFormSubmit={setManualParams} />

<WrongChainWarning />

Expand Down