-
Notifications
You must be signed in to change notification settings - Fork 47
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
Refactoring attempt for indirect-calls-executor #1155
Refactoring attempt for indirect-calls-executor #1155
Conversation
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.
Alright, I think this looks promising, and I see where it is going, but I think the most important thing is not there. The executor should not have hardcoded, which indirect calls it should execute; otherwise, we always have to mess with the executor, when we add a new call that should indirectly be executed.
I have also invested some thoughts about this topic, I invite you to comment on that: #1156.
Thank you @clangenb for the review and suggestions, it makes a lot of sense. I also left a comment in #1156, as mentioned IMHO it doesn't change much in terms of the logic but does have better readability. The question is do you still want to integrate this PR? If so I can fix the points you mentioned in the review and re-sync it. Otherwise if you don't need it for now -- simply go ahead and close it, it's completely fine :) |
Thanks for asking. I don't have a strong opinion about this PR, I think it is a useful intermediate step, however, the follow-up #1156 will not be the priority. So I would say if it makes your downstream live easier, I am happy to merge the PR after the fixes, otherwise we can just close it. |
It does, one less change is always better :) I'll fix those and request a re-review. |
Updated some files according to the review :) |
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.
Nice, thanks for the fixes! Looks good to me now!
This PR tries to do a small refactoring for indirect-calls-executor. The main changes and reasons are listed below:
indirect_calls_executor.rs
tolib.rs
, as the crate has the same name already:indirect-calls-executor/src/indirect-calls-executor.rs
seems unnecessary and overlaps withindirect-calls-executor/src/lib.rs
if ..
paradigm to a vector ofExecutor
s to more clearly illustrate how the parentchain extrinsics are handled. Otherwise we'll have longerif else
branches as more handlers are added, and readability can be significantly reduced.Executor
in an individual fileDecorateExecutor
becauseExecutor
has an associated typeexecuted_calls
to be further passed intocreate_processed_parentchain_block_call
. In the original code, onlyshield_funds
call is pushed,call_worker
not -- we think this might be wrong.