Class TxExcerptExtensions
Useful extension methods for ITxExcerpt.
Namespace: Libplanet.Tx
Assembly: Libplanet.dll
Syntax
public static class TxExcerptExtensions : object
Methods
| Improve this Doc View SourceValidateTxNonces<T>(IEnumerable<T>, Int64)
Validates if transactions
has valid nonces.
It assumes all given transactions
belong to a block together.
Declaration
public static void ValidateTxNonces<T>(this IEnumerable<T> transactions, long blockIndex)
where T : ITxExcerpt
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | transactions | A list of transactions. Their order does not matter. |
Int64 | blockIndex | The index of the block that transactions will belong to. It's only used for exception messages. |
Type Parameters
Name | Description |
---|---|
T | A transaction type. |
Exceptions
Type | Condition |
---|---|
InvalidTxNonceException | Thrown when the same tx nonce is used by a signer twice or more, or a tx nonce is used without its previous nonce by a signer. Note that this validates only a block's intrinsic integrity between its transactions, but does not guarantee integrity between blocks. Such validation needs to be conducted by BlockChain<T>. |
InvalidTxGenesisHashException | Thrown when transactions to set have inconsistent genesis hashes. |