_pkg.dev: drop mgetblocks code

This commit is contained in:
Roman Khimov 2019-08-29 19:31:10 +03:00
parent 9d8024a9dd
commit b5813efb29
2 changed files with 0 additions and 51 deletions

View file

@ -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
}

View file

@ -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())
}