@ApiAudience.Public @ApiStability.Unstable public interface NonceProvider
Modifier and Type | Method and Description |
---|---|
void |
bindNonce(AccountAddress accountAddress,
long nonce)
Bind nonce to
accountAddress . |
void |
bindNonce(AccountState accountState)
Bind nonce of
accountState with accountAddress of accountState . |
long |
getLastUsedNonce(AccountAddress accountAddress)
Get last used nonce of
accountAddress . |
long |
incrementAndGetNonce(AccountAddress accountAddress)
Increment nonce of
accountAddress get it. |
void bindNonce(AccountState accountState)
accountState
with accountAddress of accountState
. The operation
must be thread-safe.accountState
- an account statevoid bindNonce(AccountAddress accountAddress, long nonce)
accountAddress
. Next time nonce is required, it will be provided on base
of passed nonce. The operation must be thread-safe.accountAddress
- an account addressnonce
- an noncelong incrementAndGetNonce(AccountAddress accountAddress)
accountAddress
get it. If an nonce of accountAddress
is not
binded yet, it will be treated as new account (nonce starts from 0). The operation must be
thread-safe.accountAddress
- an accountAddresslong getLastUsedNonce(AccountAddress accountAddress)
accountAddress
. If an nonce of accountAddress
is not
binded yet, it will be treated as new account (nonce starts from 0). The operation must be
thread-safe.accountAddress
- an accountAddress