This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bkchr
reviewed
Mar 8, 2020
bkchr
approved these changes
Mar 10, 2020
} | ||
} | ||
|
||
pub fn get_extension<T: 'static>(e: &dyn GetExtension) -> Option<&T> { |
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.
Docs missing.
bkchr
added
A5-grumble
and removed
A0-please_review
Pull request needs code review.
labels
Mar 10, 2020
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
tomusdrw
reviewed
Mar 11, 2020
/// Helper function that queries an extension by type from `GetExtension` | ||
/// trait object. | ||
pub fn get_extension<T: 'static>(e: &dyn GetExtension) -> Option<&T> { | ||
Any::downcast_ref(GetExtension::get_any(e, TypeId::of::<T>())) |
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 is this function needed and why can't we just use Extension::get
instead?
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.
Trait objects can't have generic methods.
General-Beck
pushed a commit
to General-Beck/substrate
that referenced
this pull request
Mar 12, 2020
* ChainSpec trait * Apply suggestions from code review Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Added docs * Fixed build * Fixed build Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
General-Beck
pushed a commit
to General-Beck/substrate
that referenced
this pull request
Mar 17, 2020
* ChainSpec trait * Apply suggestions from code review Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Added docs * Fixed build * Fixed build Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
ChainSpec
is now stored inConfiguration
as a trait object.This simplifies configuring
Service
at run time with chain specs based on different nativeGenesisConfig
. (e.g. polkadot and kusama)