This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
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.
state_machine no_std witness externalities #6934
state_machine no_std witness externalities #6934
Changes from 22 commits
ea03567
c0e25ae
2cb6378
b0e04a4
a9aa27c
2747339
cac2280
11305d1
4f05206
d4ce6dd
147ef68
d067b0c
0e6b642
4c454cc
d32e3fd
753a8d7
2d63cf7
1fadc14
9b3146d
bdbaefc
d1b10c8
14e40b6
e459698
bef5997
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Why did you change this code?
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.
I did modify the 'extrinsics' prototype to stop returning an iterator (before it was fusing iterator with itertools unique but I am do not like the implementation a lot (internal hashmap), so I simply return a btreeset instead, changing the code here calling 'extrinsics' multiple times, so avoid fusing the iterator multiple time).
But I think I will remove the ChangeTrieOverlay trait that only try to avoid some foot print and is leaking a bit too much everywhere for my taste).
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.
If you change this to a
filter_map
, you almost need no changes below.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 it avoid a tab, will change (easier to review, even if I like it better without the filter map, I am really waiting for rustc "Tracking issue for methods converting
bool
toOption<T>
#64260" to get stable).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.
Oh I remember, 'extrinsics' function is not a getter, it have an associated cost, that is the main reason (even if optimized by the compilator, this way of putting it makes it clear that we don't want to call the function multiple times, but I can write it with combinator too).
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.
I see the problem. However the old implementation was also an
Iterator
that did not do anything when not called.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.
Looks much better!