Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
ettec committed Dec 13, 2024
1 parent 9b52367 commit 8677b57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"testing"
"time"

"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand All @@ -26,13 +25,6 @@ const (
workflowExecutionID1 = "95ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0abbadeed"
)

func Test_Hex(t *testing.T) {
b := []byte{}

strResult := hexutil.Encode(b)
assert.Equal(t, "", strResult)
}

func Test_ClientRequest_MessageValidation(t *testing.T) {
lggr := logger.TestLogger(t)

Expand Down
7 changes: 6 additions & 1 deletion core/services/workflows/syncer/workflow_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,16 @@ func (w *workflowRegistry) Start(_ context.Context) error {
w.lggr.Debugw("Loading initial workflows for DON", "DON", don.ID)
loadWorkflowsHead, err := w.initialWorkflowsStateLoader.LoadWorkflows(ctx, don)
if err != nil {
// TODO - this is a temporary fix to handle the case where the contract is empty, to track: https://smartcontract-it.atlassian.net/browse/CAPPL-393
// TODO - this is a temporary fix to handle the case where the chainreader errors because the contract
// contains no workflows. To track: https://smartcontract-it.atlassian.net/browse/CAPPL-393
if !strings.Contains(err.Error(), "attempting to unmarshal an empty string while arguments are expected") {
w.lggr.Errorw("failed to load workflows", "err", err)
return
}

loadWorkflowsHead = &types.Head{
Height: "0",
}
}

reader, err := w.getContractReader(ctx)
Expand Down

0 comments on commit 8677b57

Please sign in to comment.