MCPcopy Create free account
hub / github.com/CPChain/chain / AddGas

Method AddGas

core/gaspool.go:29–35  ·  view source on GitHub ↗

AddGas makes gas available for execution.

(amount uint64)

Source from the content-addressed store, hash-verified

27
28// AddGas makes gas available for execution.
29func (gp *GasPool) AddGas(amount uint64) *GasPool {
30 if uint64(*gp) > math.MaxUint64-amount {
31 panic("gas pool pushed above uint64")
32 }
33 *(*uint64)(gp) += amount
34 return gp
35}
36
37// SubGas deducts the given amount from the pool if enough gas is
38// available and returns an error otherwise.

Callers 10

SetCoinbaseMethod · 0.80
refundGasMethod · 0.80
ProcessMethod · 0.80
callContractMethod · 0.80
doCallMethod · 0.80
RunMethod · 0.80
commitTransactionsMethod · 0.80
traceBlockMethod · 0.80
traceTxMethod · 0.80
computeTxEnvMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected