Skip to content
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 @@ -409,7 +409,7 @@ export function TransferPanel() {
return
}

case 'tx': {
case 'tx_ethers': {
try {
const tx = await signer!.sendTransaction(step.payload.txRequest)
const txReceipt = await tx.wait()
Expand Down
4 changes: 2 additions & 2 deletions packages/arb-token-bridge-ui/src/ui-driver/UiDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export type UiDriverStep =
| { type: 'dialog'; payload: Dialog }
| { type: 'scw_tooltip' }
| {
type: 'tx'
type: 'tx_ethers'
payload: {
txRequest: providers.TransactionRequest
txRequestLabel: string
Expand Down Expand Up @@ -55,7 +55,7 @@ export type UiDriverStepResultFor<TStepType extends UiDriverStepType> =
? boolean
: TStepType extends 'scw_tooltip'
? void
: TStepType extends 'tx'
: TStepType extends 'tx_ethers'
? Result<providers.TransactionReceipt>
: never

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ it(`
.hasType('dialog')
.hasPayload('approve_token')
expectStep(await nextStep(generator, [true]))
.hasType('tx')
.hasType('tx_ethers')
.hasPayload(approveTokenPayload(mockedApproveTokenTxRequest))
expectStep(await nextStep(generator, [{ error: new Error() }]))
//
Expand Down Expand Up @@ -201,7 +201,7 @@ it(`
.hasType('dialog')
.hasPayload('approve_token')
expectStep(await nextStep(generator, [true]))
.hasType('tx')
.hasType('tx_ethers')
.hasPayload(approveTokenPayload(mockedApproveTokenTxRequest))
expectStep(await nextStep(generator, [{ data: {} as TransactionReceipt }]))
//
Expand Down Expand Up @@ -326,7 +326,7 @@ it(`
//
.hasType('scw_tooltip')
expectStep(await nextStep(generator))
.hasType('tx')
.hasType('tx_ethers')
.hasPayload(approveTokenPayload(mockedApproveTokenTxRequest))
expectStep(await nextStep(generator, [{ data: {} as TransactionReceipt }]))
//
Expand Down
4 changes: 2 additions & 2 deletions packages/arb-token-bridge-ui/src/ui-driver/UiDriverCctp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { step, UiDriverStepGenerator } from './UiDriver'
import {
stepGeneratorForDialog,
stepGeneratorForSmartContractWalletDestinationDialog,
stepGeneratorForTransaction
stepGeneratorForTransactionEthers
} from './UiDriverCommon'

export const stepGeneratorForCctp: UiDriverStepGenerator = async function* (
Expand All @@ -27,7 +27,7 @@ export const stepGeneratorForCctp: UiDriverStepGenerator = async function* (
amount: context.amountBigNumber
})

yield* stepGeneratorForTransaction(context, {
yield* stepGeneratorForTransactionEthers(context, {
txRequest: request,
txRequestLabel: 'stepGeneratorForCctp.approveToken'
})
Expand Down
8 changes: 4 additions & 4 deletions packages/arb-token-bridge-ui/src/ui-driver/UiDriverCommon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,24 @@ export const stepGeneratorForSmartContractWalletDestinationDialog: UiDriverStepG
}
}

export type UiDriverStepGeneratorForTransaction<
export type UiDriverStepGeneratorForTransactionEthers<
TStep extends UiDriverStep = UiDriverStep
> = (
context: UiDriverContext,
payload: UiDriverStepPayloadFor<'tx'>
payload: UiDriverStepPayloadFor<'tx_ethers'>
) => AsyncGenerator<
TStep,
providers.TransactionReceipt | void,
UiDriverStepResultFor<TStep['type']>
>

export const stepGeneratorForTransaction: UiDriverStepGeneratorForTransaction =
export const stepGeneratorForTransactionEthers: UiDriverStepGeneratorForTransactionEthers =
async function* (context, payload) {
if (context.isSmartContractWallet) {
yield* step({ type: 'scw_tooltip' })
}

const { error, data } = yield* step({ type: 'tx', payload })
const { error, data } = yield* step({ type: 'tx_ethers', payload })

if (typeof error !== 'undefined') {
yield* step({ type: 'return' })
Expand Down
Loading