Use RPC call to get account nonce (#476)

* remove code related to getting nonce from storage and use RPC call instead

* cargo fmt

* move nonce fetching into Rpc, since it's just an RPC call

* clippy
This commit is contained in:
James Wilson
2022-03-14 15:39:40 +00:00
committed by GitHub
parent 798a1d0b88
commit 8b19549560
10 changed files with 460 additions and 1086 deletions
+11
View File
@@ -324,6 +324,17 @@ impl<T: Config> Rpc<T> {
Ok(self.client.request("system_version", rpc_params![]).await?)
}
/// Fetch the current nonce for the given account ID.
pub async fn system_account_next_index(
&self,
account: &T::AccountId,
) -> Result<T::Index, BasicError> {
Ok(self
.client
.request("system_accountNextIndex", rpc_params![account])
.await?)
}
/// Get a header
pub async fn header(
&self,