-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
@@ -102,6 +105,22 @@ pub type Block = generic::Block<Header, UncheckedExtrinsic>; | |||
#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))] | |||
pub struct Concrete; | |||
|
|||
/// 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
@@ -59,6 +62,22 @@ pub use runtime_primitives::BuildStorage; | |||
/// 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?
substrate/client/src/error.rs
Outdated
@@ -70,6 +70,12 @@ error_chain! { | |||
display("Current state of blockchain has invalid authority count value"), | |||
} | |||
|
|||
/// 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.
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.
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.
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
CheckedId
because it is now obsoleted by the version check and should be handled by the substrate, rather than polkadot anyway.