start to refactor block import wrapper a bit

This commit is contained in:
Robert Habermeier
2018-11-15 18:36:16 +01:00
parent d2e928a39f
commit 1b202e1ffb
6 changed files with 26 additions and 25 deletions
@@ -39,7 +39,7 @@ impl<'a, Block, A> BlockBuilder<'a, Block, A>
where
Block: BlockT<Hash=H256>,
A: ProvideRuntimeApi + HeaderBackend<Block> + 'a,
A::Api: BlockBuilderApi<Block>,
A::Api: BlockBuilderApi<Block> + Core<Block>,
{
/// Create a new instance of builder from the given client, building on the latest block.
pub fn new(api: &'a A) -> error::Result<Self> {
@@ -84,7 +84,7 @@ where
block_id: &BlockId<Block>,
xt: Block::Extrinsic,
extrinsics: &mut Vec<Block::Extrinsic>
) -> error::Result<()> where T: BlockBuilderApi<Block> {
) -> error::Result<()> where T: BlockBuilderApi<Block> + Core<Block> {
api.map_api_result(|api| {
match api.apply_extrinsic(block_id, &xt)? {
Ok(ApplyOutcome::Success) | Ok(ApplyOutcome::Fail) => {