Skip to content

Commit

Permalink
use context.Background() instead of todo
Browse files Browse the repository at this point in the history
  • Loading branch information
walldiss committed Jun 5, 2024
1 parent dd63be8 commit d6612ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions share/shwap/sample_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestSampleNegativeVerifyInclusion(t *testing.T) {
require.NoError(t, err)
inMem := eds.Rsmt2D{ExtendedDataSquare: randEDS}

sample, err := inMem.Sample(context.TODO(), 0, 0)
sample, err := inMem.Sample(context.Background(), 0, 0)
require.NoError(t, err)
err = sample.Validate(root, 0, 0)
require.NoError(t, err)
Expand All @@ -56,14 +56,14 @@ func TestSampleNegativeVerifyInclusion(t *testing.T) {
require.ErrorIs(t, err, shwap.ErrorFailedVerification)

// incorrect proofType
sample, err = inMem.Sample(context.TODO(), 0, 0)
sample, err = inMem.Sample(context.Background(), 0, 0)
require.NoError(t, err)
sample.ProofType = rsmt2d.Col
err = sample.Validate(root, 0, 0)
require.ErrorIs(t, err, shwap.ErrorFailedVerification)

// Corrupt the last root hash byte
sample, err = inMem.Sample(context.TODO(), 0, 0)
sample, err = inMem.Sample(context.Background(), 0, 0)
require.NoError(t, err)
root.RowRoots[0][len(root.RowRoots[0])-1] ^= 0xFF
err = sample.Validate(root, 0, 0)
Expand Down

0 comments on commit d6612ba

Please sign in to comment.