-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Runtime version #256
Runtime version #256
Conversation
substrate/runtime/version/src/lib.rs
Outdated
| } | ||
|
|
||
| impl<T: Trait> Module<T> { | ||
| /// Get runtime verions |
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.
typo: version?
|
|
||
| #[cfg(feature = "std")] | ||
| impl RuntimeVersion { | ||
| /// Check if this version matches other version for calling into runtime. |
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.
can we copy descriptions from the issue? They're pretty descriptive there...
substrate/runtime/version/src/lib.rs
Outdated
| // You should have received a copy of the GNU General Public License | ||
| // along with Substrate Demo. If not, see <http://www.gnu.org/licenses/>. | ||
|
|
||
| //! Version module for runtime; Provide a function that returns runtime verion. |
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.
s/verion/version
polkadot/runtime/src/lib.rs
Outdated
|
|
||
| /// Polkadot runtime version. | ||
| pub const VERSION: RuntimeVersion = RuntimeVersion { | ||
| spec_name: ver_str!("polkatot"), |
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.
s/polkatot/polkadot
demo/runtime/src/lib.rs
Outdated
| /// Concrete runtime type used to parameterize the various modules. | ||
| pub struct Concrete; | ||
|
|
||
| /// Polkadot runtime version. |
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.
demo runtime version?
| } | ||
|
|
||
| /// Invalid state data. | ||
| VersionInvalid { |
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.
Should just assume it's the PoC-1 runtime in this case for now, once we ditch the PoC-1 chain that assumption can be removed and this error can be reinstated.
gavofyork
left a comment
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.
Pending the couple of minor changes mentioned.
gavofyork
left a comment
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.
Withdrawing approval until it's clear that the field descriptions of the original issue were faithfully followed.
gavofyork
left a comment
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.
|
Addressed all issues |
|
quoting #241:
|
Why? |
|
@rphmeier I don't see why it should be checked by the polkadot API and not the substrate. Also, |
|
@gavofyork Added that last bit |
| #[cfg(feature = "std")] | ||
| #[macro_export] | ||
| macro_rules! ver_str { | ||
| ( $y:expr ) => {{ ::std::borrow::Cow::Borrowed($y) }} |
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.
question: why using Cow for std?
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.
So that it can be defined as const and deserialised from Slicable using the same type.
…tions (paritytech#256) * strip out all ICMP code and begin gossip refactor * validate incoming statements * message_allowed logic * compiles * do reporting and neighbor packet validation * tests compile * propagate gossip messages * test message_allowed * some more tests * address grumbles
* kill processes on exit and sigint * retyped events and updated api
Updated Farming commands to reflect current snapshot
Closes #241
Does not have any performance optimisations.
I've also removed
CheckedIdbecause it is now obsoleted by the version check and should be handled by the substrate, rather than polkadot anyway.