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
5 changes: 2 additions & 3 deletions packages/sdk/src/core/BaseStepExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,8 @@ export abstract class BaseStepExecutor implements StepExecutor {

return step
} catch (error: any) {
const action = step.execution?.lastActionType
? this.statusManager.findAction(step, step.execution.lastActionType)
: undefined
// Derive failing action from last in execution.actions
const action = step.execution?.actions?.at(-1)
const parsed = await this.parseErrors(error, step, action, retryParams)
if (!(parsed instanceof ExecuteStepRetryError)) {
if (action) {
Expand Down
4 changes: 0 additions & 4 deletions packages/sdk/src/core/StatusManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export class StatusManager {
step.execution.startedAt = Date.now()
step.execution.status = 'PENDING'
step.execution.signedAt = undefined
step.execution.lastActionType = undefined
step.execution.error = undefined
this.updateStepInRoute(step)
}
Expand Down Expand Up @@ -122,7 +121,6 @@ export class StatusManager {
}

step.execution.actions.push(newAction)
step.execution.lastActionType = type
this.updateStepInRoute(step)
return newAction
}
Expand Down Expand Up @@ -201,8 +199,6 @@ export class StatusManager {
break
}

step.execution.lastActionType = type

currentAction.status = status
currentAction.message = getActionMessage(type, status)
// set extra parameters or overwrite the standard params set in the switch statement
Expand Down
2 changes: 0 additions & 2 deletions packages/sdk/src/core/StatusManager.unit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ describe('StatusManager', () => {

const updatedExecution = Object.assign({}, step.execution, {
actions: [...step.execution!.actions, action],
lastActionType: 'CROSS_CHAIN',
})

const updatedStep = Object.assign({}, step, {
Expand Down Expand Up @@ -249,7 +248,6 @@ describe('StatusManager', () => {
status === 'DONE' || status === 'CANCELLED'
const updatedExecution = Object.assign({}, step.execution, {
actions: [step.execution!.actions[0], action],
lastActionType: 'SWAP',
status: notUpdateableStatus
? step.execution!.status
: (status as ExecutionStatus),
Expand Down
2 changes: 0 additions & 2 deletions packages/sdk/src/core/prepareRestart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ export const prepareRestart = (route: RouteExtended) => {
// If no tx hash exists, reset the actions array
step.execution.actions = []
}
// Reset the last action type
step.execution.lastActionType = undefined
}
step.transactionRequest = undefined
}
Expand Down
1 change: 0 additions & 1 deletion packages/sdk/src/types/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ export interface Execution {
signedAt?: number
status: ExecutionStatus
actions: Array<ExecutionAction>
lastActionType?: ExecutionActionType
fromAmount?: string
toAmount?: string
toToken?: Token
Expand Down
Loading