Skip to content

Commit

Permalink
Revert and Test
Browse files Browse the repository at this point in the history
  • Loading branch information
shargon committed Jan 21, 2021
1 parent 10d0d62 commit 63f9731
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/neo/SmartContract/Manifest/ContractManifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public StackItem ToStackItem(ReferenceCounter referenceCounter)
Abi.ToStackItem(referenceCounter),
new Array(referenceCounter, Permissions.Select(p => p.ToStackItem(referenceCounter))),
Trusts.IsWildcard ? StackItem.Null : new Array(referenceCounter, Trusts.Select(p => (StackItem)p.ToArray())),
Extra is null ? StackItem.Null : Extra.ToByteArray(false)
Extra is null ? "null" : Extra.ToByteArray(false)
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,15 @@ public void TestDeserializeAndSerialize()
var clone = new ContractManifest();
((IInteroperable)clone).FromStackItem(expected.ToStackItem(null));

Assert.AreEqual(expected.ToString(), clone.ToString());
Assert.AreEqual(expected.Extra.ToString(), @"{""a"":123}");
Assert.AreEqual(expected.ToString(), clone.ToString());

expected.Extra = null;
clone = new ContractManifest();
((IInteroperable)clone).FromStackItem(expected.ToStackItem(null));

Assert.AreEqual(expected.Extra, clone.Extra);
Assert.AreEqual(expected.ToString(), clone.ToString());
}

[TestMethod]
Expand Down

0 comments on commit 63f9731

Please sign in to comment.