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

Method useGas

core/state_transition.go:145–152  ·  view source on GitHub ↗
(amount uint64)

Source from the content-addressed store, hash-verified

143}
144
145func (st *StateTransition) useGas(amount uint64) error {
146 if st.gas < amount {
147 return vm.ErrOutOfGas
148 }
149 st.gas -= amount
150
151 return nil
152}
153
154func (st *StateTransition) buyGas() error {
155 mgval := new(big.Int).Mul(new(big.Int).SetUint64(st.msg.Gas()), st.gasPrice)

Callers 1

TransitionDbMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected