Skip to content

Commit

Permalink
ByteArray -> ByteString (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
vncoelho authored Apr 4, 2020
1 parent bd4b9ce commit 3e1078d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/RpcNep5Tracker/RpcNep5Tracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,17 @@ private void HandleNotification(StoreView snapshot, IVerifiable scriptContainer,
{
if (stateItems.Count == 0) return;
// Event name should be encoded as a byte array.
if (!(stateItems[0] is VM.Types.ByteArray)) return;
if (!(stateItems[0] is VM.Types.ByteString)) return;
var eventName = stateItems[0].GetString();
if (eventName != "Transfer") return;
if (stateItems.Count < 4) return;

if (!(stateItems[1].IsNull) && !(stateItems[1] is VM.Types.ByteArray))
if (!(stateItems[1].IsNull) && !(stateItems[1] is VM.Types.ByteString))
return;
if (!(stateItems[2].IsNull) && !(stateItems[2] is VM.Types.ByteArray))
if (!(stateItems[2].IsNull) && !(stateItems[2] is VM.Types.ByteString))
return;
var amountItem = stateItems[3];
if (!(amountItem is VM.Types.ByteArray || amountItem is VM.Types.Integer))
if (!(amountItem is VM.Types.ByteString || amountItem is VM.Types.Integer))
return;
byte[] fromBytes = stateItems[1].IsNull ? null : stateItems[1].GetSpan().ToArray();
if (fromBytes != null && fromBytes.Length != UInt160.Length)
Expand Down

0 comments on commit 3e1078d

Please sign in to comment.