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
2019-10-16 11:02:12 +03:00
committed by Bastian Köcher
parent 6a2afdb204
commit 8ef20a5534
5 changed files with 13 additions and 5 deletions
+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() -> _>(