diff options
author | obscuren <geffobscura@gmail.com> | 2015-06-20 22:28:11 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-06-21 23:09:19 +0800 |
commit | 07c3de3f75a579cf573fae7bf7c0ec11427dda9f (patch) | |
tree | 2007b80da898cb96c9a00f1565bebb64271d712b /core/state_transition.go | |
parent | 3deded28a50398b8ce108c72f27ea861c1bce178 (diff) | |
download | dexon-07c3de3f75a579cf573fae7bf7c0ec11427dda9f.tar dexon-07c3de3f75a579cf573fae7bf7c0ec11427dda9f.tar.gz dexon-07c3de3f75a579cf573fae7bf7c0ec11427dda9f.tar.bz2 dexon-07c3de3f75a579cf573fae7bf7c0ec11427dda9f.tar.lz dexon-07c3de3f75a579cf573fae7bf7c0ec11427dda9f.tar.xz dexon-07c3de3f75a579cf573fae7bf7c0ec11427dda9f.tar.zst dexon-07c3de3f75a579cf573fae7bf7c0ec11427dda9f.zip |
core, miner, xeth: renamed gas methods
* BuyGas => SubGas
* RefundGas => AddGas
* SetGasPool => SetGasLimit
Diffstat (limited to 'core/state_transition.go')
-rw-r--r-- | core/state_transition.go | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/core/state_transition.go b/core/state_transition.go index 4a8d92375..915dd466b 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -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 -} |