Rewrite Inherent data (#1488)

* Implement new inherent data

* Fixes compilation on wasm

* Fixes after rebase

* Switch back to generate inherent stuff by macro

* Update after rebase

* Apply suggestions from code review

Co-Authored-By: bkchr <bkchr@users.noreply.github.com>

* Fix compilation after rebase

* Address grumbles

* Remove `InherentDataProviders` from `Client`

* Update wasm files after rebase

* Address grumbles

* Fixes compilation after latest merge

* Last fix
This commit is contained in:
Bastian Köcher
2019-01-22 17:52:08 +01:00
committed by GitHub
parent b14917e63f
commit 70b1af7b1e
55 changed files with 1513 additions and 661 deletions
@@ -29,9 +29,9 @@ pub trait BlockBuilderExt {
fn push_transfer(&mut self, transfer: runtime::Transfer) -> Result<(), client::error::Error>;
}
impl<'a, A> BlockBuilderExt for client::block_builder::BlockBuilder<'a, runtime::Block, (), A> where
impl<'a, A> BlockBuilderExt for client::block_builder::BlockBuilder<'a, runtime::Block, A> where
A: ProvideRuntimeApi + client::blockchain::HeaderBackend<runtime::Block> + 'a,
A::Api: BlockBuilder<runtime::Block, ()>
A::Api: BlockBuilder<runtime::Block>
{
fn push_transfer(&mut self, transfer: runtime::Transfer) -> Result<(), client::error::Error> {
self.push(sign_tx(transfer))
@@ -39,6 +39,9 @@ impl<'a, A> BlockBuilderExt for client::block_builder::BlockBuilder<'a, runtime:
}
fn sign_tx(transfer: runtime::Transfer) -> runtime::Extrinsic {
let signature = keyring::Keyring::from_raw_public(transfer.from.to_fixed_bytes()).unwrap().sign(&codec::Encode::encode(&transfer)).into();
let signature = keyring::Keyring::from_raw_public(transfer.from.to_fixed_bytes())
.unwrap()
.sign(&codec::Encode::encode(&transfer))
.into();
runtime::Extrinsic::Transfer(transfer, signature)
}