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
+12
View File
@@ -57,6 +57,18 @@ pub fn blake2_128(data: &[u8]) -> [u8; 16] {
r
}
/// Do a Blake2 64-bit hash and place result in `dest`.
pub fn blake2_64_into(data: &[u8], dest: &mut [u8; 8]) {
dest.copy_from_slice(blake2_rfc::blake2b::blake2b(8, &[], data).as_bytes());
}
/// Do a Blake2 64-bit hash and return result.
pub fn blake2_64(data: &[u8]) -> [u8; 8] {
let mut r = [0; 8];
blake2_64_into(data, &mut r);
r
}
/// Do a XX 64-bit hash and place result in `dest`.
pub fn twox_64_into(data: &[u8], dest: &mut [u8; 8]) {
use ::core::hash::Hasher;