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 @@ -383,7 +383,7 @@ export function TransferPanel() {
return true
}

const stepExecutor: UiDriverStepExecutor = async step => {
const stepExecutor: UiDriverStepExecutor = async (context, step) => {
if (process.env.NODE_ENV === 'development') {
console.log(step)
}
Expand Down
4 changes: 2 additions & 2 deletions packages/arb-token-bridge-ui/src/ui-driver/UiDriver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ it('successfully does step execution', async () => {
yield { type: 'start' }
}

const executor: UiDriverStepExecutor = async function (step) {
const executor: UiDriverStepExecutor = async function (_, step) {
if (step.type === 'start') {
counter += 1
}
Expand All @@ -39,7 +39,7 @@ it('successfully does early return', async () => {
yield { type: 'start' }
}

const executor: UiDriverStepExecutor = async function (step) {
const executor: UiDriverStepExecutor = async function (_, step) {
if (step.type === 'start') {
counter += 1
}
Expand Down
3 changes: 2 additions & 1 deletion packages/arb-token-bridge-ui/src/ui-driver/UiDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export type UiDriverStepGenerator<TStep extends UiDriverStep = UiDriverStep> = (
) => AsyncGenerator<TStep, void, UiDriverStepResultFor<TStep['type']>>

export type UiDriverStepExecutor<TStep extends UiDriverStep = UiDriverStep> = (
context: UiDriverContext,
step: TStep
) => Promise<UiDriverStepResultFor<TStep['type']>>

Expand Down Expand Up @@ -100,7 +101,7 @@ export async function drive<TStep extends UiDriverStep>(
}

// execute current step and obtain the result
const result = await executor(step)
const result = await executor(context, step)

// pass the result back into the generator
nextStep = await flow.next(result)
Expand Down
Loading