Implement legacy RPC system_account_next_index (#1250)

RPC system_account_next_index compensates for
extrinsics in transaction pool as opposed to
get_account_nonce which does not.
This commit is contained in:
Fredrik Simonsson
2023-11-09 19:08:01 +09:00
committed by GitHub
parent 633219648d
commit b8b56cb9c4
+12
View File
@@ -138,6 +138,18 @@ impl<T: Config> LegacyRpcMethods<T> {
.await
}
/// Fetch next nonce for an Account
///
/// Return account nonce adjusted for extrinsics currently in transaction pool
pub async fn system_account_next_index(&self, account_id: &T::AccountId) -> Result<u64, Error>
where
T::AccountId: Serialize,
{
self.client
.request("system_accountNextIndex", rpc_params![&account_id])
.await
}
/// Get a header
pub async fn chain_get_header(
&self,