-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix contract trust FromStackItem ContractPermissionDescriptor.Create(StackItem item)
#2901
Conversation
ContractPermissionDescriptor.Create(StackItem item)
Seems to be legit. We have appropriate NULL stored in the DB (T5 state matches between NeoGo 0.102.0 and C# 3.6), so the only question is to read it properly. |
LGTM |
// Array array when array.Any(p => ((ByteString)p).Size == 0) => WildcardContainer<ContractPermissionDescriptor>.CreateWildcard(), | ||
Array array => WildcardContainer<ContractPermissionDescriptor>.Create(array.Select(p => new ContractPermissionDescriptor(p.GetSpan())).ToArray()), | ||
Array array => WildcardContainer<ContractPermissionDescriptor>.Create(array.Select(ContractPermissionDescriptor.Create).ToArray()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well i still recommand to have this logic: if any of the permission is any
, then the permission is any
:
Array array when array.Any(p => p.Equals(StackItem.Null)) => WildcardContainer<ContractPermissionDescriptor>.CreateWildcard(),
Array array => WildcardContainer<ContractPermissionDescriptor>.Create(array.Select(ContractPermissionDescriptor.Create).ToArray()),
Co-authored-by: Jimmy <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to extend the TestSerializeTrusts
added in https://github.com/Liaojinghui/neo/pull/1/files with a wildcard deserialisation test.
Otherwise, LGTM.
Anything preventing the merge now? Tested, @superboyiii? |
If a manifest trusts presented as Null stackitem, then it should be treated as wildcard, not as restricted. It's not the same problem as described and fixed in neo-project/neo#2901 and https://github.com/neo-project/neo/pull/2892/files, although these two PRs are related. Signed-off-by: Anna Shaleva <[email protected]>
If manifest trusts presented as Null stackitem, then they should be treated as wildcard, not as restricted. It's not the same problem as described and fixed in neo-project/neo#2901 and https://github.com/neo-project/neo/pull/2892/files, although these two PRs are related. Signed-off-by: Anna Shaleva <[email protected]>
If manifest trusts presented as Null stackitem, then they should be treated as wildcard, not as restricted. It's not the same problem as described and fixed in neo-project/neo#2901 and neo-project/neo#2892, although these two PRs are related. Signed-off-by: Anna Shaleva <[email protected]>
#2899
nspcc-dev/neo-go#3105
#2890
NOT EXPECTED TO BE MERGED DIRECTLY. Just to make
ListContracts
andGetContract(0x12fbec62fb765ce3f55845106ccf3717716723ad)
work on Testnet T5 for nowhttps://github.com/Hecate2/neo/releases/tag/fix-contract-trust