-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Added commit hash to --version #489
Conversation
|
It looks like @simonljs hasn't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement at the following URL: https://cla-polkadot.parity.io Once you've signed, please reply to this thread with Many thanks, Parity Technologies CLA Bot |
|
[clabot:check] |
|
It looks like @simonljs signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
| } | ||
|
|
||
| /// Returns full version string, using supplied version and commit. | ||
| pub fn full_version_from_strs(impl_version: &str, impl_commit: &str) -> String { |
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.
note: bad style to have a function without self parameter inside an impl block. Could you move this to a free function in the module?
| { | ||
| panic_hook::set(); | ||
|
|
||
| let full_version = service::Configuration::<<F>::Configuration, <F>::Genesis> |
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.
this type would not be necessary to specify if this were a free function. i.e. it would just be
let full_version = service::full_version_from_strs(...)
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.
Followed up in #496
* master: Add Links to Tags and House Style (#413) Add seed generation tests (#476) Added commit hash to --version (#489) use write_all instead of write (#488) should be MAX_IMPORTING_BLOCKS (#486) Use hex_literal in tests, use rustc-hex from crates (#481) Lower bft timeout (#483) force BFT delay in consensus service, not in proposer logic (#477)
* Change genesis key * Fix build error * Update chain_spec * Fix grandpa finalize gossip
…proof-call Disable calls in pallet-executor
* Add "dev_getBlockStats" RPC * build fix
I have assumed that it is the full extended version name that is desired i.e. version, commit hash, platform as used in the telemetry and when starting Polkadot.
There is already a function in service::Configuration to produce this text string so it makes sense to call into it for consistency. I have made this logic available statically however, so that it can be called before there is an instance of Configuration (which can only be created after the --version string has been set because it requires return values of clap::App)
This function could be moved outside of Configuration if preferable.