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

Refactor SignOrExecuteForm #4326

Open
compojoom opened this issue Oct 7, 2024 · 0 comments
Open

Refactor SignOrExecuteForm #4326

compojoom opened this issue Oct 7, 2024 · 0 comments

Comments

@compojoom
Copy link
Collaborator

The recent bug in the SignOrExecuteForm #4325 showed that we need to investigate how to refactor it and how to increase the test coverage. This bug has been live in production for the past 2 months and we only now noticed.

We should figure out if there is a better way to display custom decoding per type. The confirmation order views are very similar
grafik

to the tx Details

grafik

but still not the same.

        {decodedData && (
          <ErrorBoundary fallback={<></>}>
            <ConfirmationOrder decodedData={decodedData} toAddress={safeTx?.data.to ?? ''} />
          </ErrorBoundary>
        )}

The ConfirmationOrder component is only going to render if we are dealing with a Stake or Swap tx. But then in order not to duplicate the information we have

{showTxDetails && <TxData txDetails={txDetails} imitation={false} trusted />}

showTxDetails is defined as

  const showTxDetails =
    props.txId &&
    txDetails &&
    !isCustomTxInfo(txDetails.txInfo) &&
    !isAnyStakingTxInfo(txDetails.txInfo) &&
    !isOrderTxInfo(txDetails.txInfo)

If we now introduce more custom decodings we will need to exclude them in the showTxDetails which I'm sure we are going to forget to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant