Class InitialResponseBuilder.ResponseCreator

    • Field Summary

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

        deserializer, updatesExtractor
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ResponseCreator()  
    • Method Detail

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