Show / Hide Table of Contents

Class TxExcerptExtensions

Useful extension methods for ITxExcerpt.

Inheritance
Object
TxExcerptExtensions
Namespace: Libplanet.Tx
Assembly: Libplanet.dll
Syntax
public static class TxExcerptExtensions : object

Methods

| Improve this Doc View Source

ValidateTxNonces<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.

  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2022 Planetarium