Skip to content

Commit

Permalink
fix test build
Browse files Browse the repository at this point in the history
  • Loading branch information
fschoell committed Dec 14, 2023
1 parent c4b7e20 commit d00ba5b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 51 deletions.
45 changes: 0 additions & 45 deletions codec/block_test.go

This file was deleted.

16 changes: 10 additions & 6 deletions codec/consolereader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"fmt"
"github.com/andreyvit/diff"
antelope_v3_1 "github.com/pinax-network/firehose-antelope/codec/antelope/v3.1"
"github.com/pinax-network/firehose-antelope/types"
pbantelope "github.com/pinax-network/firehose-antelope/types/pb/sf/antelope/type/v1"
firecore "github.com/streamingfast/firehose-core"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -69,7 +68,13 @@ func TestParseFromFile(t *testing.T) {
return nil, err
}

return out.ToProtocol().(*pbantelope.Block), nil
pbBlock := &pbantelope.Block{}
err = out.Payload.UnmarshalTo(pbBlock)
if err != nil {
return nil, err
}

return pbBlock, nil
}

buf := &bytes.Buffer{}
Expand Down Expand Up @@ -147,13 +152,12 @@ func TestGeneratePBBlocks(t *testing.T) {
for {
out, err := cr.ReadBlock()
if out != nil {
bstreamBlock, err := types.BlockFromProto(block)
require.NoError(t, err)

pbBlock, err := bstreamBlock.ToProto()
pbBlock := &pbantelope.Block{}
err = out.Payload.UnmarshalTo(pbBlock)
require.NoError(t, err)

outputFile, err := os.Create(fmt.Sprintf("testdata/pbblocks/battlefield-block.%d.pb", block.Number))
outputFile, err := os.Create(fmt.Sprintf("testdata/pbblocks/battlefield-block.%d.pb", pbBlock.Number))
require.NoError(t, err)

pbBlockBytes, err := proto.Marshal(pbBlock)
Expand Down

0 comments on commit d00ba5b

Please sign in to comment.