Update everything to latest master (#247)

This commit is contained in:
Bastian Köcher
2020-11-25 15:45:49 +01:00
committed by GitHub
parent 66576cb6b4
commit c75b59758d
10 changed files with 426 additions and 339 deletions
+38 -40
View File
@@ -43,7 +43,7 @@ use sp_trie::MemoryDB;
type StorageValue = Vec<u8>;
type StorageKey = Vec<u8>;
type Ext<'a, B: BlockT> = sp_state_machine::Ext<
type Ext<'a, B> = sp_state_machine::Ext<
'a,
HashFor<B>,
NumberFor<B>,
@@ -93,45 +93,43 @@ pub fn validate_block<B: BlockT, E: ExecuteBlock<B>>(params: ValidationParams) -
params: &params,
};
let _guard = unsafe {
(
// Replace storage calls with our own implementations
sp_io::storage::host_read.replace_implementation(host_storage_read),
sp_io::storage::host_set.replace_implementation(host_storage_set),
sp_io::storage::host_get.replace_implementation(host_storage_get),
sp_io::storage::host_exists.replace_implementation(host_storage_exists),
sp_io::storage::host_clear.replace_implementation(host_storage_clear),
sp_io::storage::host_root.replace_implementation(host_storage_root),
sp_io::storage::host_clear_prefix.replace_implementation(host_storage_clear_prefix),
sp_io::storage::host_changes_root.replace_implementation(host_storage_changes_root),
sp_io::storage::host_append.replace_implementation(host_storage_append),
sp_io::storage::host_next_key.replace_implementation(host_storage_next_key),
sp_io::storage::host_start_transaction
.replace_implementation(host_storage_start_transaction),
sp_io::storage::host_rollback_transaction
.replace_implementation(host_storage_rollback_transaction),
sp_io::storage::host_commit_transaction
.replace_implementation(host_storage_commit_transaction),
sp_io::default_child_storage::host_get
.replace_implementation(host_default_child_storage_get),
sp_io::default_child_storage::host_read
.replace_implementation(host_default_child_storage_read),
sp_io::default_child_storage::host_set
.replace_implementation(host_default_child_storage_set),
sp_io::default_child_storage::host_clear
.replace_implementation(host_default_child_storage_clear),
sp_io::default_child_storage::host_storage_kill
.replace_implementation(host_default_child_storage_storage_kill),
sp_io::default_child_storage::host_exists
.replace_implementation(host_default_child_storage_exists),
sp_io::default_child_storage::host_clear_prefix
.replace_implementation(host_default_child_storage_clear_prefix),
sp_io::default_child_storage::host_root
.replace_implementation(host_default_child_storage_root),
sp_io::default_child_storage::host_next_key
.replace_implementation(host_default_child_storage_next_key),
)
};
let _guard = (
// Replace storage calls with our own implementations
sp_io::storage::host_read.replace_implementation(host_storage_read),
sp_io::storage::host_set.replace_implementation(host_storage_set),
sp_io::storage::host_get.replace_implementation(host_storage_get),
sp_io::storage::host_exists.replace_implementation(host_storage_exists),
sp_io::storage::host_clear.replace_implementation(host_storage_clear),
sp_io::storage::host_root.replace_implementation(host_storage_root),
sp_io::storage::host_clear_prefix.replace_implementation(host_storage_clear_prefix),
sp_io::storage::host_changes_root.replace_implementation(host_storage_changes_root),
sp_io::storage::host_append.replace_implementation(host_storage_append),
sp_io::storage::host_next_key.replace_implementation(host_storage_next_key),
sp_io::storage::host_start_transaction
.replace_implementation(host_storage_start_transaction),
sp_io::storage::host_rollback_transaction
.replace_implementation(host_storage_rollback_transaction),
sp_io::storage::host_commit_transaction
.replace_implementation(host_storage_commit_transaction),
sp_io::default_child_storage::host_get
.replace_implementation(host_default_child_storage_get),
sp_io::default_child_storage::host_read
.replace_implementation(host_default_child_storage_read),
sp_io::default_child_storage::host_set
.replace_implementation(host_default_child_storage_set),
sp_io::default_child_storage::host_clear
.replace_implementation(host_default_child_storage_clear),
sp_io::default_child_storage::host_storage_kill
.replace_implementation(host_default_child_storage_storage_kill),
sp_io::default_child_storage::host_exists
.replace_implementation(host_default_child_storage_exists),
sp_io::default_child_storage::host_clear_prefix
.replace_implementation(host_default_child_storage_clear_prefix),
sp_io::default_child_storage::host_root
.replace_implementation(host_default_child_storage_root),
sp_io::default_child_storage::host_next_key
.replace_implementation(host_default_child_storage_next_key),
);
set_and_run_with_externalities(&mut ext, || {
E::execute_block(block);