diff options
author | obscuren <geffobscura@gmail.com> | 2015-02-01 22:29:57 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-02-01 22:29:57 +0800 |
commit | d52878c744fd7acce727feb41c2d4296e56826d3 (patch) | |
tree | 6b9f101f57a5ac0902b80f252214caa5ed63eb8c /cmd/mist | |
parent | 0d97c3ce1322083fb9683a5afec004b2626b620a (diff) | |
download | go-tangerine-d52878c744fd7acce727feb41c2d4296e56826d3.tar.gz go-tangerine-d52878c744fd7acce727feb41c2d4296e56826d3.tar.zst go-tangerine-d52878c744fd7acce727feb41c2d4296e56826d3.zip |
Removed some VMEnv & Added VmType() to vm.Environment
Diffstat (limited to 'cmd/mist')
-rw-r--r-- | cmd/mist/debugger.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cmd/mist/debugger.go b/cmd/mist/debugger.go index dc6a39560..c1ab2f3f1 100644 --- a/cmd/mist/debugger.go +++ b/cmd/mist/debugger.go @@ -29,6 +29,7 @@ import ( "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/state" "github.com/ethereum/go-ethereum/vm" @@ -154,14 +155,17 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data block := self.lib.eth.ChainManager().CurrentBlock() - env := utils.NewEnv(self.lib.eth.ChainManager(), statedb, block, account.Address(), value) + msg := types.NewTransactionMessage(nil, value, gas, gasPrice, data) + env := core.NewEnv(statedb, self.lib.eth.ChainManager(), msg, block) self.Logf("callsize %d", len(script)) go func() { + pgas := new(big.Int).Set(gas) ret, err := env.Call(account, contract.Address(), data, gas, gasPrice, ethutil.Big0) - //ret, g, err := callerClosure.Call(evm, data) - tot := new(big.Int).Mul(env.Gas, gasPrice) - self.Logf("gas usage %v total price = %v (%v)", env.Gas, tot, ethutil.CurrencyToString(tot)) + + rgas := new(big.Int).Sub(pgas, gas) + tot := new(big.Int).Mul(rgas, gasPrice) + self.Logf("gas usage %v total price = %v (%v)", rgas, tot, ethutil.CurrencyToString(tot)) if err != nil { self.Logln("exited with errors:", err) } else { |