Transaction versioning in the RuntimeVersion (#5582)

* Add transaction_version

* Semantic versioning for runtimes

* Move new field to bottom

* Versioning

* Runtime versioning stuff.

* Fix test

* Adds tests and fixes bugs

* Bump runtime

Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
Gavin Wood
2020-04-17 12:10:31 +02:00
committed by GitHub
parent fea626ca84
commit fd2cb9ca83
12 changed files with 149 additions and 11 deletions
+15 -3
View File
@@ -93,17 +93,29 @@ pub struct RuntimeVersion {
)
)]
pub apis: ApisVec,
/// All existing dispatches are fully compatible when this number doesn't change. If this
/// number changes, then `spec_version` must change, also.
///
/// This number must change when an existing dispatchable (module ID, dispatch ID) is changed,
/// either through an alteration in its user-level semantics, a parameter added/removed/changed,
/// a dispatchable being removed, a module being removed, or a dispatchable/module changing its
/// index.
///
/// It need *not* change when a new module is added or when a dispatchable is added.
pub transaction_version: u32,
}
#[cfg(feature = "std")]
impl fmt::Display for RuntimeVersion {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}-{}:{}({}-{})",
write!(f, "{}-{} ({}-{}.tx{}.au{})",
self.spec_name,
self.spec_version,
self.authoring_version,
self.impl_name,
self.impl_version
self.impl_version,
self.transaction_version,
self.authoring_version,
)
}
}