aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/mist
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-01 22:29:57 +0800
committerobscuren <geffobscura@gmail.com>2015-02-01 22:29:57 +0800
commitd52878c744fd7acce727feb41c2d4296e56826d3 (patch)
tree6b9f101f57a5ac0902b80f252214caa5ed63eb8c /cmd/mist
parent0d97c3ce1322083fb9683a5afec004b2626b620a (diff)
downloaddexon-d52878c744fd7acce727feb41c2d4296e56826d3.tar.gz
dexon-d52878c744fd7acce727feb41c2d4296e56826d3.tar.zst
dexon-d52878c744fd7acce727feb41c2d4296e56826d3.zip
Removed some VMEnv & Added VmType() to vm.Environment
Diffstat (limited to 'cmd/mist')
-rw-r--r--cmd/mist/debugger.go12
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 {