Skip to content

Commit

Permalink
add extra check
Browse files Browse the repository at this point in the history
  • Loading branch information
augustbleeds committed Jul 18, 2024
1 parent a9cc1b0 commit aba6bc4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion relayer/pkg/chainlink/ocr2/medianreport/report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"testing"
"time"

"github.com/NethermindEth/starknet.go/curve"
starknetutils "github.com/NethermindEth/starknet.go/utils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand Down Expand Up @@ -71,8 +73,15 @@ func TestBuildReportNoObserversOverflow(t *testing.T) {
})
}

_, err := c.BuildReport(oo)
report, err := c.BuildReport(oo)
assert.Nil(t, err)

index := timestampSizeBytes
observersBytes := []byte(report[index : index+observersSizeBytes])
observersBig := starknetutils.BytesToBig(observersBytes)

// encoded observers felt is less than max felt
assert.Equal(t, -1, observersBig.Cmp(curve.Curve.P))
}

func TestBuildReport(t *testing.T) {
Expand Down

0 comments on commit aba6bc4

Please sign in to comment.