Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ContractManifest serialization #2254

Merged
merged 7 commits into from
Jan 21, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/neo/SmartContract/Manifest/ContractManifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void IInteroperable.FromStackItem(StackItem stackItem)
Array array => WildcardContainer<UInt160>.Create(array.Select(p => new UInt160(p.GetSpan())).ToArray()),
_ => throw new ArgumentException(null, nameof(stackItem))
};
Extra = JObject.Parse(@struct[6].GetSpan());
Extra = @struct[6].IsNull ? null : JObject.Parse(@struct[6].GetSpan());
erikzhang marked this conversation as resolved.
Show resolved Hide resolved
}

public StackItem ToStackItem(ReferenceCounter referenceCounter)
Expand All @@ -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 ? "null" : Extra.ToByteArray(false)
Extra is null ? StackItem.Null : Extra.ToByteArray(false)
erikzhang marked this conversation as resolved.
Show resolved Hide resolved
};
}

Expand Down