diff --git a/pkg/consensus/payload.go b/pkg/consensus/payload.go index f8f635314..52ba5c4b8 100644 --- a/pkg/consensus/payload.go +++ b/pkg/consensus/payload.go @@ -160,7 +160,7 @@ func (p *Payload) SetHeight(h uint32) { } // EncodeBinaryUnsigned writes payload to w excluding signature. -func (p Payload) EncodeBinaryUnsigned(w *io.BinWriter) { +func (p *Payload) EncodeBinaryUnsigned(w *io.BinWriter) { w.WriteLE(p.version) w.WriteBytes(p.prevHash[:]) w.WriteLE(p.height) diff --git a/pkg/core/account_state.go b/pkg/core/account_state.go index daf07b805..cd79fe189 100644 --- a/pkg/core/account_state.go +++ b/pkg/core/account_state.go @@ -140,7 +140,7 @@ func (u *UnspentBalance) DecodeBinary(r *io.BinReader) { } // EncodeBinary implements io.Serializable interface. -func (u UnspentBalance) EncodeBinary(w *io.BinWriter) { +func (u *UnspentBalance) EncodeBinary(w *io.BinWriter) { u.Tx.EncodeBinary(w) w.WriteLE(u.Index) w.WriteLE(u.Value) diff --git a/pkg/core/block.go b/pkg/core/block.go index e1e898ed7..2a6af8d27 100644 --- a/pkg/core/block.go +++ b/pkg/core/block.go @@ -115,7 +115,8 @@ func (b *Block) Trim() ([]byte, error) { buf.WriteVarUint(uint64(len(b.Transactions))) for _, tx := range b.Transactions { - tx.Hash().EncodeBinary(buf.BinWriter) + h := tx.Hash() + h.EncodeBinary(buf.BinWriter) } if buf.Err != nil { return nil, buf.Err diff --git a/pkg/core/notification_event.go b/pkg/core/notification_event.go index fc1c6e727..ee0086cc3 100644 --- a/pkg/core/notification_event.go +++ b/pkg/core/notification_event.go @@ -56,7 +56,7 @@ func getAppExecResultFromStore(s storage.Store, hash util.Uint256) (*AppExecResu } // EncodeBinary implements the Serializable interface. -func (ne NotificationEvent) EncodeBinary(w *io.BinWriter) { +func (ne *NotificationEvent) EncodeBinary(w *io.BinWriter) { w.WriteBytes(ne.ScriptHash[:]) vm.EncodeBinaryStackItem(ne.Item, w) } diff --git a/pkg/util/uint256.go b/pkg/util/uint256.go index 81521e1b8..b8b5588bf 100644 --- a/pkg/util/uint256.go +++ b/pkg/util/uint256.go @@ -117,7 +117,7 @@ func (u Uint256) MarshalJSON() ([]byte, error) { func (u Uint256) CompareTo(other Uint256) int { return bytes.Compare(u[:], other[:]) } // EncodeBinary implements io.Serializable interface. -func (u Uint256) EncodeBinary(w *io.BinWriter) { +func (u *Uint256) EncodeBinary(w *io.BinWriter) { w.WriteBytes(u[:]) }