Skip to content

Commit

Permalink
fix testing types
Browse files Browse the repository at this point in the history
  • Loading branch information
fschoell committed Dec 14, 2023
1 parent d80f15c commit 7e625eb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
15 changes: 4 additions & 11 deletions codec/testing/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"github.com/pinax-network/firehose-antelope/types"
"github.com/streamingfast/bstream"
pbbstream "github.com/streamingfast/bstream/pb/sf/bstream/v1"
"google.golang.org/protobuf/types/known/timestamppb"
"os"
Expand All @@ -16,7 +17,6 @@ import (
"github.com/eoscanada/eos-go/system"
"github.com/mitchellh/go-testing-interface"
"github.com/pinax-network/firehose-antelope/types/pb/sf/antelope/type/v1"
"github.com/streamingfast/bstream"
"github.com/streamingfast/jsonpb"
"github.com/streamingfast/logging"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -157,28 +157,21 @@ func Block(t testing.T, blkID string, components ...interface{}) *pbantelope.Blo
return pbblock
}

func ToBstreamBlock(t testing.T, block *pbantelope.Block) *bstream.Block {
func ToBstreamBlock(t testing.T, block *pbantelope.Block) *pbbstream.Block {
blk, err := types.BlockFromProto(block, block.LIBNum())
require.NoError(t, err)

return blk
}

func ToBstreamBlocks(t testing.T, blocks []*pbantelope.Block) (out []*bstream.Block) {
out = make([]*bstream.Block, len(blocks))
func ToBstreamBlocks(t testing.T, blocks []*pbantelope.Block) (out []*pbbstream.Block) {
out = make([]*pbbstream.Block, len(blocks))
for i, block := range blocks {
out[i] = ToBstreamBlock(t, block)
}
return
}

func ToPbbstreamBlock(t testing.T, block *pbantelope.Block) *pbbstream.Block {
blk, err := ToBstreamBlock(t, block).ToProto()
require.NoError(t, err)

return blk
}

type TrxID string

func TrxTrace(t testing.T, components ...interface{}) *pbantelope.TransactionTrace {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ toolchain go1.21.4

require (
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883
github.com/eoscanada/eos-go v0.9.1-0.20200415144303-2adb25bcdeca
github.com/eoscanada/eos-go v0.10.3-0.20231109144819-59afdfa3a37d
github.com/lytics/ordpool v0.0.0-20130426221837-8d833f097fe7
github.com/mitchellh/go-testing-interface v1.14.1
github.com/spf13/cobra v1.7.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBF
github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE=
github.com/eoscanada/eos-go v0.9.1-0.20200415144303-2adb25bcdeca h1:aj+U4pJtWRP1MUBLanJR/jxQkI2UcQn0Tximh7b41qY=
github.com/eoscanada/eos-go v0.9.1-0.20200415144303-2adb25bcdeca/go.mod h1:exxz2Fyjqx23FIYF1QlhhhggYZxcbZMGp2H/4h7I34Y=
github.com/eoscanada/eos-go v0.10.3-0.20231109144819-59afdfa3a37d h1:vK5PijzcJaUPOhgWvY9lL99H9t3lrRNHx2IDHqS0ILc=
github.com/eoscanada/eos-go v0.10.3-0.20231109144819-59afdfa3a37d/go.mod h1:L3avCf8OkDrjlUeNy9DdoV67TCmDNj2dSlc5Xp3DNNk=
github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og=
Expand Down

0 comments on commit 7e625eb

Please sign in to comment.