Skip to content

Commit c5b2f3f

Browse files
committed
fix lint
1 parent caa2e66 commit c5b2f3f

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ require (
1818
github.com/tidwall/gjson v1.10.2
1919
github.com/tidwall/wal v1.1.7
2020
github.com/zbiljic/go-filelock v0.0.0-20170914061330-1dbf7103ab7d
21+
golang.org/x/crypto v0.14.0
2122
golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb
2223
modernc.org/sqlite v1.26.0
2324
)
@@ -74,7 +75,6 @@ require (
7475
github.com/tidwall/tinylru v1.1.0 // indirect
7576
go.etcd.io/bbolt v1.3.7 // indirect
7677
go.opencensus.io v0.23.0 // indirect
77-
golang.org/x/crypto v0.14.0 // indirect
7878
golang.org/x/mod v0.11.0 // indirect
7979
golang.org/x/net v0.17.0 // indirect
8080
golang.org/x/sync v0.3.0 // indirect

sc/universal_accumulator/client_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func TestAddEntriesStream_EdgeCases(t *testing.T) {
9999
entryChan := make(chan AccumulatorKVPair)
100100
close(entryChan)
101101

102-
ctx := t.Context()
102+
ctx := context.Background()
103103
err = acc.AddEntriesStream(ctx, entryChan, 10)
104104
if err != nil {
105105
t.Fatalf("Failed to handle empty channel: %v", err)
@@ -109,7 +109,7 @@ func TestAddEntriesStream_EdgeCases(t *testing.T) {
109109
t.Run("ContextCancellation", func(t *testing.T) {
110110
entryChan := make(chan AccumulatorKVPair)
111111

112-
ctx, cancel := context.WithCancel(t.Context())
112+
ctx, cancel := context.WithCancel(context.Background())
113113
defer close(entryChan)
114114

115115
// Cancel immediately
@@ -122,7 +122,7 @@ func TestAddEntriesStream_EdgeCases(t *testing.T) {
122122
})
123123

124124
t.Run("SlowProducer", func(t *testing.T) {
125-
ctx, cancel := context.WithTimeout(t.Context(), 2*time.Second)
125+
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
126126
defer cancel()
127127

128128
entryChan := make(chan AccumulatorKVPair)
@@ -230,7 +230,7 @@ func TestAPI_ErrorHandling(t *testing.T) {
230230
})
231231

232232
t.Run("AddEntriesStream_Uninitialized", func(t *testing.T) {
233-
ctx := t.Context()
233+
ctx := context.Background()
234234
entryChan := make(chan AccumulatorKVPair)
235235
close(entryChan)
236236

sc/universal_accumulator/integration_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package universalaccumulator
22

33
import (
4+
"context"
45
"crypto/rand"
56
"encoding/hex"
67
"fmt"
@@ -476,7 +477,7 @@ func TestStreamingAPI(t *testing.T) {
476477
}()
477478

478479
// Process streaming data
479-
ctx := t.Context()
480+
ctx := context.Background()
480481
bufferSize := 1000
481482

482483
start := time.Now()

sc/universal_accumulator/proof.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (api *AccumulatorProofAPI) GetProof(
9191
}
9292

9393
// Construct the full key: address + storage_key
94-
fullKey := append(addr, key...)
94+
fullKey := append(append([]byte(nil), addr...), key...)
9595

9696
// Generate witness
9797
witness, err := api.acc.IssueWitness(fullKey, value, exists)

sc/universal_accumulator/proof_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func TestAccumulatorProofAPI_Basic(t *testing.T) {
9292
storage.SetStorageValue(address, storageKey, storageValue)
9393

9494
// Add some data to accumulator for height 100
95-
fullKey := append(address, storageKey...)
95+
fullKey := append(append([]byte(nil), address...), storageKey...)
9696
changeset := AccumulatorChangeset{
9797
Version: 100,
9898
Entries: []AccumulatorKVPair{
@@ -153,7 +153,7 @@ func TestAccumulatorProofAPI_GetProof(t *testing.T) {
153153
storage.SetStorageValue(address, storageKey, storageValue)
154154

155155
// Add data to accumulator
156-
fullKey := append(address, storageKey...)
156+
fullKey := append(append([]byte(nil), address...), storageKey...)
157157
changeset := AccumulatorChangeset{
158158
Version: 200,
159159
Entries: []AccumulatorKVPair{
@@ -259,7 +259,7 @@ func TestAccumulatorProofAPI_VerifyProof(t *testing.T) {
259259
storage.SetStorageValue(address, storageKey, storageValue)
260260

261261
// Add data to accumulator
262-
fullKey := append(address, storageKey...)
262+
fullKey := append(append([]byte(nil), address...), storageKey...)
263263
changeset := AccumulatorChangeset{
264264
Version: 300,
265265
Entries: []AccumulatorKVPair{

0 commit comments

Comments
 (0)