Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: delete Test_dataFromSharesBSR #2271

Merged
merged 1 commit into from
May 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.