Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
arijitAD committed Dec 2, 2021
1 parent b6dda94 commit 02eb1dd
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions dot/network/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ import (
"errors"
"fmt"

"google.golang.org/protobuf/proto"

pb "github.com/ChainSafe/gossamer/dot/network/proto"
"github.com/ChainSafe/gossamer/dot/types"
"github.com/ChainSafe/gossamer/lib/common"
"github.com/ChainSafe/gossamer/lib/common/variadic"
"github.com/ChainSafe/gossamer/pkg/scale"
"google.golang.org/protobuf/proto"
)

// Message types for notifications protocol messages. Used internally to map message to protocol.
Expand Down Expand Up @@ -305,8 +306,7 @@ func blockDataToProtobuf(bd *types.BlockData) (*pb.BlockData, error) {

func protobufToBlockData(pbd *pb.BlockData) (*types.BlockData, error) {
bd := &types.BlockData{
Hash: common.BytesToHash(pbd.Hash),
Header: types.NewEmptyHeader(),
Hash: common.BytesToHash(pbd.Hash),
}

if pbd.Header != nil {
Expand All @@ -317,8 +317,6 @@ func protobufToBlockData(pbd *pb.BlockData) (*types.BlockData, error) {
}

bd.Header = header
} else {
bd.Header = nil
}

if pbd.Body != nil {
Expand Down

0 comments on commit 02eb1dd

Please sign in to comment.