-
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
SmartContract: add FindOptions.Backwards to iterate in reverse order #2819
SmartContract: add FindOptions.Backwards to iterate in reverse order #2819
Conversation
Depending on the data scheme contracts may want to iterate over prefix in descending order. Fixes neo-project#2789.
Co-authored-by: Erik Zhang <erik@neo.org>
@erikzhang @roman-khimov Let's move on. |
@shargon Mind to review this on? |
@Liaojinghui, @superboyiii, @erikzhang, could you review this PR, please? Let's move on with it, it's pretty useful. |
key2.Should().Be(items.ElementAt(2).Key); | ||
value2.Should().Be(items.ElementAt(2).Value); | ||
key1.Should().Be(items.ElementAt(3).Key); | ||
value1.Should().Be(items.ElementAt(3).Value); |
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.
tests for the null cases length 0?
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.
Fixed and improved impl. a bit.
And add a test for null/empty cases.
0c99b16
core: add `Backwards` option to System.Storage.Find Port neo-project/neo#2819.
Depending on the data scheme contracts may want to iterate over prefix in descending order. Fixes #2789.