Skip to content

Commit

Permalink
chore(lint): goimports and line length
Browse files Browse the repository at this point in the history
  • Loading branch information
distractedm1nd committed Sep 22, 2022
1 parent 32d0bb1 commit 03df83b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
1 change: 1 addition & 0 deletions ipld/nmt_adder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ipld

import (
"context"

"github.com/ipfs/go-blockservice"
"github.com/ipfs/go-merkledag"

Expand Down
12 changes: 8 additions & 4 deletions service/share/eds.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package share
import (
"context"
"fmt"
"github.com/tendermint/tendermint/pkg/consts"
"io"
"math"

"github.com/tendermint/tendermint/pkg/consts"

"github.com/ipfs/go-blockservice"
"github.com/ipfs/go-cid"
ds "github.com/ipfs/go-datastore"
Expand Down Expand Up @@ -171,9 +172,12 @@ func quadrantOrder(eds *rsmt2d.ExtendedDataSquare) [][]byte {
for j := 0; j < quadrantWidth; j++ {
q0Cell := eds.GetCell(uint(i), uint(j))
shares[(0*quadrantSize)+i*quadrantWidth+j] = append(q0Cell[:8], q0Cell...)
shares[(1*quadrantSize)+i*quadrantWidth+j] = append(consts.ParitySharesNamespaceID, eds.GetCell(uint(i), uint(j+quadrantWidth))...)
shares[(2*quadrantSize)+i*quadrantWidth+j] = append(consts.ParitySharesNamespaceID, eds.GetCell(uint(i+quadrantWidth), uint(j))...)
shares[(3*quadrantSize)+i*quadrantWidth+j] = append(consts.ParitySharesNamespaceID, eds.GetCell(uint(i+quadrantWidth), uint(j+quadrantWidth))...)
shares[(1*quadrantSize)+i*quadrantWidth+j] =
append(consts.ParitySharesNamespaceID, eds.GetCell(uint(i), uint(j+quadrantWidth))...)
shares[(2*quadrantSize)+i*quadrantWidth+j] =
append(consts.ParitySharesNamespaceID, eds.GetCell(uint(i+quadrantWidth), uint(j))...)
shares[(3*quadrantSize)+i*quadrantWidth+j] =
append(consts.ParitySharesNamespaceID, eds.GetCell(uint(i+quadrantWidth), uint(j+quadrantWidth))...)
}
}
return shares
Expand Down
18 changes: 10 additions & 8 deletions service/share/eds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ package share

import (
"context"
"github.com/celestiaorg/celestia-node/ipld"
"github.com/celestiaorg/rsmt2d"
"os"
"testing"

ds "github.com/ipfs/go-datastore"
blockstore "github.com/ipfs/go-ipfs-blockstore"
carv1 "github.com/ipld/go-car"
"os"
"testing"

"github.com/celestiaorg/celestia-node/ipld"
"github.com/celestiaorg/rsmt2d"

"github.com/stretchr/testify/require"
)
Expand All @@ -19,10 +21,10 @@ func TestQuadrantOrder(t *testing.T) {
{1}, {2},
{3}, {4},
}, rsmt2d.NewRSGF8Codec(), rsmt2d.NewDefaultTree)
//{{1}, {2}, {7}, {13}},
//{{3}, {4}, {13}, {31}},
//{{5}, {14}, {19}, {41}},
//{{9}, {26}, {47}, {69}},
// {{1}, {2}, {7}, {13}},
// {{3}, {4}, {13}, {31}},
// {{5}, {14}, {19}, {41}},
// {{9}, {26}, {47}, {69}},
require.Equal(t,
[][]byte{
{1}, {2}, {3}, {4},
Expand Down

0 comments on commit 03df83b

Please sign in to comment.