Class InitialResponseBuilder.ResponseCreator

java.lang.Object
io.hotmoka.local.internal.transactions.AbstractResponseBuilder<Request,Response>.io.hotmoka.local.internal.transactions.AbstractResponseBuilder.ResponseCreator
io.hotmoka.local.InitialResponseBuilder.ResponseCreator
Enclosing class:
InitialResponseBuilder<Request extends InitialTransactionRequest<Response>,Response extends InitialTransactionResponse>

protected abstract class InitialResponseBuilder.ResponseCreator extends io.hotmoka.local.internal.transactions.AbstractResponseBuilder<Request,Response>.io.hotmoka.local.internal.transactions.AbstractResponseBuilder.ResponseCreator
  • Field Summary

    Fields inherited from class io.hotmoka.local.internal.transactions.AbstractResponseBuilder.ResponseCreator

    deserializer, updatesExtractor
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    Decreases the available gas by the given amount, for CPU execution.
    final void
    Decreases the available gas by the given amount, for RAM execution.
    final void
    event(Object event)
    Takes note of the given event, emitted during this execution.
    final <T> T
    withGas(BigInteger amount, Callable<T> what)
    Runs a given piece of code with a subset of the available gas.

    Methods inherited from class io.hotmoka.local.internal.transactions.AbstractResponseBuilder.ResponseCreator

    addToTotalSupply, body, canCallMintBurnFromGamete, create, deserializeLastUpdateFor, deserializeLastUpdateForFinal, extractUpdatesFrom, getClassLoader, getNextStorageReference, isSystemCall, now

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • chargeGasForCPU

      public final void chargeGasForCPU(BigInteger amount)
      Description copied from class: io.hotmoka.local.internal.transactions.AbstractResponseBuilder.ResponseCreator
      Decreases the available gas by the given amount, for CPU execution.
      Specified by:
      chargeGasForCPU in class io.hotmoka.local.internal.transactions.AbstractResponseBuilder<Request extends InitialTransactionRequest<Response>,Response extends InitialTransactionResponse>.io.hotmoka.local.internal.transactions.AbstractResponseBuilder.ResponseCreator
      Parameters:
      amount - the amount of gas to consume
    • chargeGasForRAM

      public final void chargeGasForRAM(BigInteger amount)
      Description copied from class: io.hotmoka.local.internal.transactions.AbstractResponseBuilder.ResponseCreator
      Decreases the available gas by the given amount, for RAM execution.
      Specified by:
      chargeGasForRAM in class io.hotmoka.local.internal.transactions.AbstractResponseBuilder<Request extends InitialTransactionRequest<Response>,Response extends InitialTransactionResponse>.io.hotmoka.local.internal.transactions.AbstractResponseBuilder.ResponseCreator
      Parameters:
      amount - the amount of gas to consume
    • event

      public final void event(Object event)
      Description copied from class: io.hotmoka.local.internal.transactions.AbstractResponseBuilder.ResponseCreator
      Takes note of the given event, emitted during this execution.
      Specified by:
      event in class io.hotmoka.local.internal.transactions.AbstractResponseBuilder<Request extends InitialTransactionRequest<Response>,Response extends InitialTransactionResponse>.io.hotmoka.local.internal.transactions.AbstractResponseBuilder.ResponseCreator
      Parameters:
      event - the event
    • withGas

      public final <T> T withGas(BigInteger amount, Callable<T> what) throws Exception
      Description copied from class: io.hotmoka.local.internal.transactions.AbstractResponseBuilder.ResponseCreator
      Runs a given piece of code with a subset of the available gas. It first charges the given amount of gas. Then runs the code with the charged gas only. At its end, the remaining gas is added to the available gas to continue the computation.
      Specified by:
      withGas in class io.hotmoka.local.internal.transactions.AbstractResponseBuilder<Request extends InitialTransactionRequest<Response>,Response extends InitialTransactionResponse>.io.hotmoka.local.internal.transactions.AbstractResponseBuilder.ResponseCreator
      Parameters:
      amount - the amount of gas provided to the code
      what - the code to run
      Returns:
      the result of the execution of the code
      Throws:
      Exception - if the code runs into this exception