Skip to content

Commit

Permalink
test: delete Test_dataFromSharesBSR (#2271)
Browse files Browse the repository at this point in the history
Closes #2267
  • Loading branch information
rootulp committed May 29, 2023
1 parent 6e0f3b9 commit 009d5a9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 45 deletions.
37 changes: 0 additions & 37 deletions api/gateway/share_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ package gateway

import (
_ "embed"
"encoding/base64"
"encoding/json"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
coretypes "github.com/tendermint/tendermint/types"

Expand Down Expand Up @@ -48,37 +45,3 @@ func Test_dataFromShares(t *testing.T) {

require.Equal(t, testData, parsedSSSShares)
}

// sharesBase64JSON is the base64 encoded share data from Blockspace Race
// block height 559108 and namespace e8e5f679bf7116cb.
//
//go:embed "testdata/sharesBase64.json"
var sharesBase64JSON string

// Test_dataFromSharesBSR reproduces an error that occurred when parsing shares
// on Blockspace Race block height 559108 namespace e8e5f679bf7116cb.
//
// https://github.com/celestiaorg/celestia-app/issues/1816
func Test_dataFromSharesBSR(t *testing.T) {
t.Skip("skip until sharesBase64JSON is regenerated with v1 compatibility")

var sharesBase64 []string
err := json.Unmarshal([]byte(sharesBase64JSON), &sharesBase64)
assert.NoError(t, err)
input := decode(sharesBase64)

_, err = dataFromShares(input)
assert.NoError(t, err)
}

// decode returns the raw shares from base64Encoded.
func decode(base64Encoded []string) (rawShares [][]byte) {
for _, share := range base64Encoded {
rawShare, err := base64.StdEncoding.DecodeString(share)
if err != nil {
panic(err)
}
rawShares = append(rawShares, rawShare)
}
return rawShares
}
8 changes: 0 additions & 8 deletions api/gateway/testdata/sharesBase64.json

This file was deleted.

0 comments on commit 009d5a9

Please sign in to comment.