mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-08 17:07:21 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user