fix contract trust FromStackItem ContractPermissionDescriptor.Create(StackItem item)#2901
Merged
shargon merged 4 commits intoneo-project:masterfrom Sep 25, 2023
Merged
Conversation
ContractPermissionDescriptor.Create(StackItem item)
Contributor
|
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. |
Jim8y
previously approved these changes
Sep 8, 2023
Contributor
|
LGTM |
Jim8y
reviewed
Sep 8, 2023
Jim8y
reviewed
Sep 8, 2023
Comment on lines
83
to
+84
| // 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()), |
Contributor
There was a problem hiding this comment.
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 <jinghui@wayne.edu>
Jim8y
approved these changes
Sep 8, 2023
shargon
approved these changes
Sep 11, 2023
AnnaShaleva
reviewed
Sep 11, 2023
Member
AnnaShaleva
left a comment
There was a problem hiding this comment.
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.
Closed
Contributor
|
Anything preventing the merge now? Tested, @superboyiii? |
Member
superboyiii
approved these changes
Sep 25, 2023
AnnaShaleva
added a commit
to nspcc-dev/neo-go
that referenced
this pull request
Sep 25, 2023
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 <shaleva.ann@nspcc.ru>
AnnaShaleva
added a commit
to nspcc-dev/neo-go
that referenced
this pull request
Sep 25, 2023
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 <shaleva.ann@nspcc.ru>
AnnaShaleva
added a commit
to nspcc-dev/neo-go
that referenced
this pull request
Sep 25, 2023
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 <shaleva.ann@nspcc.ru>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


#2899
nspcc-dev/neo-go#3105
#2890
NOT EXPECTED TO BE MERGED DIRECTLY. Just to make
ListContractsandGetContract(0x12fbec62fb765ce3f55845106ccf3717716723ad)work on Testnet T5 for nowhttps://github.com/Hecate2/neo/releases/tag/fix-contract-trust