-
Notifications
You must be signed in to change notification settings - Fork 790
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
[xcm-emulator] Add on_initialize
and on_finalize
hooks
#2007
base: master
Are you sure you want to change the base?
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.
I appreciate the code formatting, but it is unrelated on some files. I would keep that in a separate PR
on_initialize
and on_finalize
hookson_initialize
and on_finalize
hooks
on_initialize
and on_finalize
hookson_initialize
and on_finalize
hooks
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.
The PR is still very green. It is not even compiling, check the CI. Ping me again when you think it is done :)
substrate/frame/support/procedural/src/pallet/expand/warnings.rs
Outdated
Show resolved
Hide resolved
Co-authored-by: Ignacio Palacios <[email protected]>
Co-authored-by: Ignacio Palacios <[email protected]>
Co-authored-by: Ignacio Palacios <[email protected]>
Co-authored-by: Ignacio Palacios <[email protected]>
Co-authored-by: Ignacio Palacios <[email protected]>
This reverts commit 8c03551.
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 you are only calling the hooks for Parachains. It should be called for Relay Chain also.
Can you prove it really works and the hooks calls are placed in the proper place? You could for example try to move AuraExt::on_initialize(1)
from on_init
to a new struct for hooks
@@ -578,7 +592,8 @@ macro_rules! decl_test_parachains { | |||
}, | |||
pallets = { | |||
$($pallet_name:ident: $pallet_path:path,)* | |||
} | |||
}, | |||
hooks = $on_hooks:ty, |
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.
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 am not sure that something like:
hooks = {
$($pallet_name:ident: $pallet_path:path,)*
}
could be possible to be passed as argument of __impl_test_ext_for_parachain/relay()
Having the OnHooks
trait also gives more flexibility to the dev in case he wants to execute some custom code during on_initialize/on_finalize()
Closes #1384