Skip to content

Commit

Permalink
fix: add error type for operation not ready
Browse files Browse the repository at this point in the history
  • Loading branch information
ecPablo committed Feb 3, 2025
1 parent 535a8ce commit e759628
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (

// OperationNotReadyError is returned when an operation is not yet ready.
type OperationNotReadyError struct {
GlobalIndex int
OpIndex int
}

// Error implements the error interface.
func (e *OperationNotReadyError) Error() string {
return fmt.Sprintf("operation %d is not ready", e.GlobalIndex)
return fmt.Sprintf("operation %d is not ready", e.OpIndex)
}

// InvalidProposalKindError is returned when an invalid proposal kind is provided.
Expand Down
2 changes: 1 addition & 1 deletion timelock_executable.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (t *TimelockExecutable) IsReady(ctx context.Context) error {
return err
}
if !isReady {
return &OperationNotReadyError{GlobalIndex: globalIndex}
return &OperationNotReadyError{OpIndex: globalIndex}
}
}

Expand Down

0 comments on commit e759628

Please sign in to comment.