diff --git a/src/ApplicationLogs/Store/States/BlockLogState.cs b/src/ApplicationLogs/Store/States/BlockLogState.cs index a37c83510..f42024498 100644 --- a/src/ApplicationLogs/Store/States/BlockLogState.cs +++ b/src/ApplicationLogs/Store/States/BlockLogState.cs @@ -31,6 +31,7 @@ public static BlockLogState Create(Guid[] notifyLogIds) => public virtual void Deserialize(ref MemoryReader reader) { + // It should be safe because it filled from a block's notifications. uint aLen = reader.ReadUInt32(); NotifyLogIds = new Guid[aLen]; for (int i = 0; i < aLen; i++) diff --git a/src/ApplicationLogs/Store/States/ContractLogState.cs b/src/ApplicationLogs/Store/States/ContractLogState.cs index f645bbb91..32d0521d0 100644 --- a/src/ApplicationLogs/Store/States/ContractLogState.cs +++ b/src/ApplicationLogs/Store/States/ContractLogState.cs @@ -56,8 +56,8 @@ public override void Serialize(BinaryWriter writer) #region IEquatable public bool Equals(ContractLogState other) => - EventName == other.EventName && StackItemIds.SequenceEqual(other.StackItemIds) && - TransactionHash == other.TransactionHash && Trigger == other.Trigger; + Trigger == other.Trigger && EventName == other.EventName && + TransactionHash == other.TransactionHash && StackItemIds.SequenceEqual(other.StackItemIds); public override bool Equals(object obj) { diff --git a/src/ApplicationLogs/Store/States/EngineLogState.cs b/src/ApplicationLogs/Store/States/EngineLogState.cs index 0102e9e1b..73eba95be 100644 --- a/src/ApplicationLogs/Store/States/EngineLogState.cs +++ b/src/ApplicationLogs/Store/States/EngineLogState.cs @@ -33,6 +33,7 @@ public static EngineLogState Create(UInt160 scriptHash, string message) => public virtual void Deserialize(ref MemoryReader reader) { ScriptHash.Deserialize(ref reader); + // It should be safe because it filled from a transaction's logs. Message = reader.ReadVarString(); } diff --git a/src/ApplicationLogs/Store/States/ExecutionLogState.cs b/src/ApplicationLogs/Store/States/ExecutionLogState.cs index e37a46cc9..706ce543c 100644 --- a/src/ApplicationLogs/Store/States/ExecutionLogState.cs +++ b/src/ApplicationLogs/Store/States/ExecutionLogState.cs @@ -45,6 +45,7 @@ public void Deserialize(ref MemoryReader reader) Exception = reader.ReadVarString(); GasConsumed = reader.ReadInt64(); + // It should be safe because it filled from a transaction's stack. uint aLen = reader.ReadUInt32(); StackItemIds = new Guid[aLen]; for (int i = 0; i < aLen; i++) diff --git a/src/ApplicationLogs/Store/States/NotifyLogState.cs b/src/ApplicationLogs/Store/States/NotifyLogState.cs index 996c611fa..fe22308ad 100644 --- a/src/ApplicationLogs/Store/States/NotifyLogState.cs +++ b/src/ApplicationLogs/Store/States/NotifyLogState.cs @@ -40,6 +40,7 @@ public virtual void Deserialize(ref MemoryReader reader) ScriptHash.Deserialize(ref reader); EventName = reader.ReadVarString(); + // It should be safe because it filled from a transaction's notifications. uint aLen = reader.ReadUInt32(); StackItemIds = new Guid[aLen]; for (int i = 0; i < aLen; i++) @@ -61,8 +62,8 @@ public virtual void Serialize(BinaryWriter writer) #region IEquatable public bool Equals(NotifyLogState other) => - EventName == other.EventName && StackItemIds.SequenceEqual(other.StackItemIds) && - ScriptHash == other.ScriptHash; + EventName == other.EventName && ScriptHash == other.ScriptHash && + StackItemIds.SequenceEqual(other.StackItemIds); public override bool Equals(object obj) { diff --git a/src/ApplicationLogs/Store/States/TransactionEngineLogState.cs b/src/ApplicationLogs/Store/States/TransactionEngineLogState.cs index 55b5fbae0..dc029b268 100644 --- a/src/ApplicationLogs/Store/States/TransactionEngineLogState.cs +++ b/src/ApplicationLogs/Store/States/TransactionEngineLogState.cs @@ -30,6 +30,7 @@ public static TransactionEngineLogState Create(Guid[] logIds) => public virtual void Deserialize(ref MemoryReader reader) { + // It should be safe because it filled from a transaction's logs. uint aLen = reader.ReadUInt32(); LogIds = new Guid[aLen]; for (int i = 0; i < aLen; i++) diff --git a/src/ApplicationLogs/Store/States/TransactionLogState.cs b/src/ApplicationLogs/Store/States/TransactionLogState.cs index c637d6bb3..7d768fa80 100644 --- a/src/ApplicationLogs/Store/States/TransactionLogState.cs +++ b/src/ApplicationLogs/Store/States/TransactionLogState.cs @@ -31,6 +31,7 @@ public static TransactionLogState Create(Guid[] notifyLogIds) => public virtual void Deserialize(ref MemoryReader reader) { + // It should be safe because it filled from a transaction's notifications. uint aLen = reader.ReadUInt32(); NotifyLogIds = new Guid[aLen]; for (int i = 0; i < aLen; i++)