TxBalance

scalus.cardano.ledger.utils.TxBalance
object TxBalance

The value a transaction consumes and produces.

The ledger sums both sides with Haskell's Integer, and so do consumedExact and producedExact, which the value-conservation rule compares. A transaction sets amounts of up to Long.MaxValue in its outputs, deposits and withdrawals, so a Long sum could wrap around and make two different totals look equal. consumed and produced return the same totals as a Value and throw ArithmeticException when one does not fit.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
TxBalance.type

Members list

Value members

Concrete methods

def consumed(tx: Transaction, certState: CertState, utxos: Utxos, protocolParams: ProtocolParams): Either[BadInputsUTxOException, Value]

The value tx consumes, as Haskell conwayConsumed.

The value tx consumes, as Haskell conwayConsumed.

Attributes

Throws
java.lang.ArithmeticException

when an amount does not fit in a Long

def produced(tx: Transaction, protocolParams: ProtocolParams): Value

The value tx produces, with a pool deposit for every pool registration, as no pool is registered. Use the overload with a CertState for a tx that may re-register a pool.

The value tx produces, with a pool deposit for every pool registration, as no pool is registered. Use the overload with a CertState for a tx that may re-register a pool.

Attributes

Throws
java.lang.ArithmeticException

when an amount does not fit in a Long

def produced(tx: Transaction, certState: CertState, protocolParams: ProtocolParams): Value

The value tx produces, as Haskell conwayProducedValue. A pool registration pays the pool deposit only for a pool not in certState and not registered earlier in the tx.

The value tx produces, as Haskell conwayProducedValue. A pool registration pays the pool deposit only for a pool not in certState and not registered earlier in the tx.

Attributes

Throws
java.lang.ArithmeticException

when an amount does not fit in a Long