From b5813efb291f1a3376f79d5fe76c7e70dd0f94c6 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 29 Aug 2019 19:31:10 +0300 Subject: [PATCH] _pkg.dev: drop mgetblocks code --- _pkg.dev/wire/payload/mgetblocks.go | 24 --------------------- _pkg.dev/wire/payload/mgetblocks_test.go | 27 ------------------------ 2 files changed, 51 deletions(-) delete mode 100644 _pkg.dev/wire/payload/mgetblocks.go delete mode 100644 _pkg.dev/wire/payload/mgetblocks_test.go diff --git a/_pkg.dev/wire/payload/mgetblocks.go b/_pkg.dev/wire/payload/mgetblocks.go deleted file mode 100644 index c6daf8ee2..000000000 --- a/_pkg.dev/wire/payload/mgetblocks.go +++ /dev/null @@ -1,24 +0,0 @@ -package payload - -import ( - "github.com/CityOfZion/neo-go/pkg/wire/command" - "github.com/CityOfZion/neo-go/pkg/wire/util" -) - -// GetBlocksMessage represnts a GetBlocks message on the neo-network -type GetBlocksMessage struct { - *GetHeadersMessage -} - -// NewGetBlocksMessage returns a GetBlocksMessage object -func NewGetBlocksMessage(start []util.Uint256, stop util.Uint256) (*GetBlocksMessage, error) { - GetHeaders, err := newAbstractGetHeaders(start, stop, command.GetBlocks) - - if err != nil { - return nil, err - } - return &GetBlocksMessage{ - GetHeaders, - }, nil - -} diff --git a/_pkg.dev/wire/payload/mgetblocks_test.go b/_pkg.dev/wire/payload/mgetblocks_test.go deleted file mode 100644 index d413bfc9a..000000000 --- a/_pkg.dev/wire/payload/mgetblocks_test.go +++ /dev/null @@ -1,27 +0,0 @@ -package payload - -import ( - "crypto/sha256" - "testing" - - "github.com/CityOfZion/neo-go/pkg/wire/command" - "github.com/CityOfZion/neo-go/pkg/wire/util" - "github.com/stretchr/testify/assert" -) - -func TestGetBlocksCommandType(t *testing.T) { - var ( - start = []util.Uint256{ - sha256.Sum256([]byte("a")), - sha256.Sum256([]byte("b")), - sha256.Sum256([]byte("c")), - sha256.Sum256([]byte("d")), - } - stop = sha256.Sum256([]byte("e")) - ) - - getBlocks, err := NewGetBlocksMessage(start, stop) - - assert.Equal(t, err, nil) - assert.Equal(t, command.GetBlocks, getBlocks.Command()) -}