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

SmartContract: add FindOptions.Backwards to iterate in reverse order #2819

Merged
merged 7 commits into from
Apr 12, 2023

Conversation

roman-khimov
Copy link
Contributor

Depending on the data scheme contracts may want to iterate over prefix in descending order. Fixes #2789.

Depending on the data scheme contracts may want to iterate over prefix in
descending order. Fixes neo-project#2789.
AnnaShaleva
AnnaShaleva previously approved these changes Sep 28, 2022
src/Neo/SmartContract/ApplicationEngine.Storage.cs Outdated Show resolved Hide resolved
Syntax sweetener.

Co-authored-by: Anna Shaleva <shaleva.ann@gmail.com>
AnnaShaleva
AnnaShaleva previously approved these changes Feb 3, 2023
@mialbu mialbu mentioned this pull request Feb 9, 2023
12 tasks
@superboyiii
Copy link
Member

@erikzhang @roman-khimov Let's move on.

@Jim8y
Copy link
Contributor

Jim8y commented Mar 15, 2023

@shargon Mind to review this on?

shargon
shargon previously approved these changes Mar 21, 2023
AnnaShaleva
AnnaShaleva previously approved these changes Apr 6, 2023
@AnnaShaleva
Copy link
Member

@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);
Copy link
Member

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?

Copy link
Contributor Author

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.

Jim8y
Jim8y previously approved these changes Apr 10, 2023
@roman-khimov roman-khimov dismissed stale reviews from Jim8y, AnnaShaleva, and shargon via 0c99b16 April 10, 2023 15:29
@shargon shargon merged commit d6620cb into neo-project:master Apr 12, 2023
@roman-khimov roman-khimov deleted the findoptions-backwards branch April 12, 2023 12:02
roman-khimov added a commit to nspcc-dev/neo-go that referenced this pull request Apr 12, 2023
core: add `Backwards` option to System.Storage.Find

Port neo-project/neo#2819.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a FindOption to control SeekDirection of Storage.Find
7 participants