Runtime API clean up (#892)

* Rename `NewTxQueue` to `TaggedTransactionQueue`

* Remove `BlockBuilder` API and support adding documentation to the API functions

* Adds new `BlockBuilder` API

* Fixes compilation with new `BlockBuilder` API

* Some more cleanup

* Cargo.lock update

* Try to fix on stable
This commit is contained in:
Bastian Köcher
2018-10-09 14:01:23 +02:00
committed by GitHub
parent 2c65ad6c7b
commit 6b4b8b8f8e
9 changed files with 240 additions and 170 deletions
+2 -2
View File
@@ -162,7 +162,7 @@ impl<'a, C: 'a + Client> Lookup for LocalContext<'a, C> {
type Source = Address;
type Target = AccountId;
fn lookup(&self, a: Address) -> ::std::result::Result<AccountId, &'static str> {
self.0.lookup_address(&BlockId::number(self.current_height()), a).unwrap_or(None).ok_or("error with lookup")
self.0.lookup_address(&BlockId::number(self.current_height()), &a).unwrap_or(None).ok_or("error with lookup")
}
}
@@ -223,7 +223,7 @@ impl<C: Client> transaction_pool::ChainApi for ChainApi<C> {
// transaction-pool trait.
let api = &self.api;
let next_index = known_nonces.entry(sender)
.or_insert_with(|| api.account_nonce(at, sender).ok().unwrap_or_else(Bounded::max_value));
.or_insert_with(|| api.account_nonce(at, &sender).ok().unwrap_or_else(Bounded::max_value));
trace!(target: "transaction-pool", "Next index for sender is {}; xt index is {}", next_index, xt.verified.index);