core: fix encoding and decoding for notification event

This commit is contained in:
Vsevolod Brekelov 2019-11-26 18:24:54 +03:00
parent ec17654986
commit c7ac4b6dff
2 changed files with 9 additions and 1 deletions

View file

@ -27,7 +27,7 @@ import (
// Tuning parameters. // Tuning parameters.
const ( const (
headerBatchCount = 2000 headerBatchCount = 2000
version = "0.0.2" version = "0.0.3"
// This one comes from C# code and it's different from the constant used // This one comes from C# code and it's different from the constant used
// when creating an asset with Neo.Asset.Create interop call. It looks // when creating an asset with Neo.Asset.Create interop call. It looks

View file

@ -39,11 +39,19 @@ func (ne *NotificationEvent) DecodeBinary(r *io.BinReader) {
// EncodeBinary implements the Serializable interface. // EncodeBinary implements the Serializable interface.
func (aer *AppExecResult) EncodeBinary(w *io.BinWriter) { func (aer *AppExecResult) EncodeBinary(w *io.BinWriter) {
w.WriteBytes(aer.TxHash[:]) w.WriteBytes(aer.TxHash[:])
w.WriteLE(aer.Trigger)
w.WriteString(aer.VMState)
w.WriteLE(aer.GasConsumed)
w.WriteString(aer.Stack)
w.WriteArray(aer.Events) w.WriteArray(aer.Events)
} }
// DecodeBinary implements the Serializable interface. // DecodeBinary implements the Serializable interface.
func (aer *AppExecResult) DecodeBinary(r *io.BinReader) { func (aer *AppExecResult) DecodeBinary(r *io.BinReader) {
r.ReadBytes(aer.TxHash[:]) r.ReadBytes(aer.TxHash[:])
r.ReadLE(&aer.Trigger)
aer.VMState = r.ReadString()
r.ReadLE(&aer.GasConsumed)
aer.Stack = r.ReadString()
r.ReadArray(&aer.Events) r.ReadArray(&aer.Events)
} }