Skip to content

Commit

Permalink
Test fix and lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kidambisrinivas committed Sep 30, 2024
1 parent e23f0d1 commit 017c1f7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
3 changes: 0 additions & 3 deletions core/capabilities/testutils/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ func NewEVMBackendTH(t *testing.T) *EVMBackendTH {
chainID := testutils.SimulatedChainID
gasLimit := uint32(ethconfig.Defaults.Miner.GasCeil) //nolint:gosec
backend := cltest.NewSimulatedBackend(t, genesisData, gasLimit)
blockTime := time.UnixMilli(int64(backend.Blockchain().CurrentHeader().Time)) //nolint:gosec
err = backend.AdjustTime(time.Since(blockTime) - 24*time.Hour)
require.NoError(t, err)
backend.Commit()

// Setup backend client
Expand Down
10 changes: 0 additions & 10 deletions core/capabilities/testutils/chain_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,3 @@ func GetBigIntValL2(m map[string]any, level1Key string, level2Key string) (*big.
}
return GetBigIntVal(level2Map, level2Key)
}

// Pretty print a map as a JSON string
func PrintMap(m map[string]any, prefix string, lggr logger.Logger) error {
json, err := json.MarshalIndent(m, "", " ")
if err != nil {
return err
}
lggr.Infow(prefix, "map", string(json))
return nil
}
5 changes: 2 additions & 3 deletions core/capabilities/triggers/logevent/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ func TestLogEventTriggerEVMHappyPath(t *testing.T) {
}()

// Wait for logs with a timeout
_, output, err := testutils.WaitForLog(th.BackendTH.Lggr, log1Ch, 5*time.Second)
require.NoError(t, err)
err = testutils.PrintMap(output, "EmitLog", th.BackendTH.Lggr)
_, output, err := testutils.WaitForLog(th.BackendTH.Lggr, log1Ch, 15*time.Second)
require.NoError(t, err)
th.BackendTH.Lggr.Infow("EmitLog", "output", output)
// Verify if valid cursor is returned
cursor, err := testutils.GetStrVal(output, "Cursor")
require.NoError(t, err)
Expand Down

0 comments on commit 017c1f7

Please sign in to comment.