Fix #1536: do not require to construct a block for encoding it (#3813)

* Fix #1536: do not require to construct a block for encoding it

* Bump `impl_version`

* Improve `Block::encode_from` signature and rustdoc (from review by @bkchr)
This commit is contained in:
Fabio Tudone authored and Bastian Köcher committed 2019-10-16 10:02:12 +02:00
1 parent 6a2afdb204
commit 8ef20a5534
5 files changed
+13 -5

No files matched your search

+4 -4
View File
@@ -1059,10 +1059,10 @@ impl<B, E, Block, RA> Client<B, E, Block, RA> where
}
};
let encoded_block = <Block as BlockT>::new(
import_headers.pre().clone(),
body.unwrap_or_default(),
).encode();
let encoded_block = <Block as BlockT>::encode_from(
import_headers.pre(),
&body.unwrap_or_default()
);
let (_, storage_update, changes_update) = self.executor
.call_at_state::<_, _, NeverNativeValue, fn() -> _>(