From 7e625eb3fc621a286b6fcfa65b5ac4a2e76c3628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20Sch=C3=B6ll?= Date: Thu, 14 Dec 2023 11:29:17 +0100 Subject: [PATCH] fix testing types --- codec/testing/types.go | 15 ++++----------- go.mod | 2 +- go.sum | 2 ++ 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/codec/testing/types.go b/codec/testing/types.go index 1b567aa..59db1a4 100644 --- a/codec/testing/types.go +++ b/codec/testing/types.go @@ -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" @@ -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" @@ -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 { diff --git a/go.mod b/go.mod index ad8ef29..e5d0331 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 5051841..ff698dd 100644 --- a/go.sum +++ b/go.sum @@ -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=