Skip to content

Commit

Permalink
Use pointer receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
dimartiro committed Sep 24, 2024
1 parent f879df0 commit 425d34f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dot/network/messages/warp_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ func (wpr *WarpProofRequest) Decode(in []byte) error {
}

// Encode encodes the warp sync request
func (wpr WarpProofRequest) Encode() ([]byte, error) {
return scale.Marshal(wpr)
func (wpr *WarpProofRequest) Encode() ([]byte, error) {
if wpr == nil {
return nil, fmt.Errorf("cannot encode nil WarpProofRequest")
}
return scale.Marshal(*wpr)
}

// String returns the string representation of a WarpProofRequest
Expand Down

0 comments on commit 425d34f

Please sign in to comment.