core, miner, xeth: renamed gas methods

* BuyGas => SubGas
* RefundGas => AddGas
* SetGasPool => SetGasLimit
This commit is contained in:
obscuren
2015-06-20 16:28:11 +02:00
parent 3deded28a5
commit 07c3de3f75
6 changed files with 10 additions and 34 deletions

View File

@ -151,7 +151,7 @@ func (self *StateTransition) BuyGas() error {
}
coinbase := self.Coinbase()
err = coinbase.BuyGas(self.msg.Gas(), self.msg.GasPrice())
err = coinbase.SubGas(self.msg.Gas(), self.msg.GasPrice())
if err != nil {
return err
}
@ -245,20 +245,9 @@ func (self *StateTransition) refundGas() {
self.gas.Add(self.gas, refund)
self.state.AddBalance(sender.Address(), refund.Mul(refund, self.msg.GasPrice()))
coinbase.RefundGas(self.gas, self.msg.GasPrice())
coinbase.AddGas(self.gas, self.msg.GasPrice())
}
func (self *StateTransition) gasUsed() *big.Int {
return new(big.Int).Sub(self.initialGas, self.gas)
}
// Converts an message in to a state object
func makeContract(msg Message, state *state.StateDB) *state.StateObject {
faddr, _ := msg.From()
addr := crypto.CreateAddress(faddr, msg.Nonce())
contract := state.GetOrNewStateObject(addr)
contract.SetInitCode(msg.Data())
return contract
}