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 -
Method Summary
Modifier and TypeMethodDescriptionfinal voidchargeGasForCPU(BigInteger amount) Decreases the available gas by the given amount, for CPU execution.final voidchargeGasForRAM(BigInteger amount) Decreases the available gas by the given amount, for RAM execution.final voidTakes note of the given event, emitted during this execution.final <T> TwithGas(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
-
Constructor Details
-
ResponseCreator
- Throws:
TransactionRejectedException
-
-
Method Details
-
chargeGasForCPU
Description copied from class:io.hotmoka.local.internal.transactions.AbstractResponseBuilder.ResponseCreatorDecreases the available gas by the given amount, for CPU execution.- Specified by:
chargeGasForCPUin classio.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
Description copied from class:io.hotmoka.local.internal.transactions.AbstractResponseBuilder.ResponseCreatorDecreases the available gas by the given amount, for RAM execution.- Specified by:
chargeGasForRAMin classio.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
Description copied from class:io.hotmoka.local.internal.transactions.AbstractResponseBuilder.ResponseCreatorTakes note of the given event, emitted during this execution.- Specified by:
eventin classio.hotmoka.local.internal.transactions.AbstractResponseBuilder<Request extends InitialTransactionRequest<Response>,Response extends InitialTransactionResponse>.io.hotmoka.local.internal.transactions.AbstractResponseBuilder.ResponseCreator - Parameters:
event- the event
-
withGas
Description copied from class:io.hotmoka.local.internal.transactions.AbstractResponseBuilder.ResponseCreatorRuns 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:
withGasin classio.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 codewhat- the code to run- Returns:
- the result of the execution of the code
- Throws:
Exception- if the code runs into this exception
-