Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
walldiss committed Aug 4, 2023
1 parent 054f5c7 commit 732704e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 30 deletions.
4 changes: 3 additions & 1 deletion share/eds/edstest/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,7 @@ func RandEDSWithNamespace(
shares := sharetest.RandSharesWithNamespace(t, namespace, size*size)
eds, err := rsmt2d.ComputeExtendedDataSquare(shares, share.DefaultRSMT2DCodec(), wrapper.NewConstructor(uint64(size)))
require.NoError(t, err, "failure to recompute the extended data square")
return eds, da.NewDataAvailabilityHeader(eds)
dah, err := da.NewDataAvailabilityHeader(eds)
require.NoError(t, err)
return eds, dah
}
12 changes: 8 additions & 4 deletions share/getters/shrex_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package getters

import (
"bytes"
"context"
"math/rand"
"sort"
"encoding/binary"
"errors"
"math/rand"
"sort"
"testing"
"time"

Expand All @@ -19,6 +20,7 @@ import (
"github.com/stretchr/testify/require"

"github.com/celestiaorg/celestia-app/pkg/da"
"github.com/celestiaorg/celestia-app/pkg/wrapper"
libhead "github.com/celestiaorg/go-header"
"github.com/celestiaorg/nmt"
"github.com/celestiaorg/rsmt2d"
Expand Down Expand Up @@ -67,7 +69,7 @@ func TestShrexGetter(t *testing.T) {

// generate test data
namespace := sharetest.RandV0Namespace()
randEDS, dah := edstest.RandEDSWithNamespace(t, namespace, 64)
randEDS, dah := singleNamespaceEds(t, namespace, 64)
require.NoError(t, edsStore.Put(ctx, dah.Hash(), randEDS))
peerManager.Validate(ctx, srvHost.ID(), shrexsub.Notification{
DataHash: dah.Hash(),
Expand Down Expand Up @@ -390,5 +392,7 @@ func singleNamespaceEds(
sort.Slice(shares, func(i, j int) bool { return bytes.Compare(shares[i], shares[j]) < 0 })
eds, err := rsmt2d.ComputeExtendedDataSquare(shares, share.DefaultRSMT2DCodec(), wrapper.NewConstructor(uint64(size)))
require.NoError(t, err, "failure to recompute the extended data square")
return eds, da.NewDataAvailabilityHeader(eds)
dah, err := da.NewDataAvailabilityHeader(eds)
require.NoError(t, err)
return eds, dah
}
46 changes: 22 additions & 24 deletions share/p2p/shrexnd/pb/share.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion share/p2p/shrexnd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ func NewServer(params *Parameters, host host.Host, store *eds.Store, getter shar
ctx, cancel := context.WithCancel(context.Background())
srv.cancel = cancel


srv.handler = srv.middleware.RateLimitHandler(srv.streamHandler(ctx))
return srv, nil
}
Expand Down

0 comments on commit 732704e

Please sign in to comment.