From 55b1c1546b72b24b087cecf18f3e52bad5c758c8 Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 2 Apr 2015 13:55:35 +0200 Subject: Moved to function --- xeth/xeth.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'xeth') diff --git a/xeth/xeth.go b/xeth/xeth.go index d9a34695a..cb2319865 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -29,6 +29,9 @@ var ( defaultGas = big.NewInt(90000) //500000 ) +func DefaultGas() *big.Int { return new(big.Int).Set(defaultGas) } +func DefaultGasPrice() *big.Int { return new(big.Int).Set(defaultGasPrice) } + type XEth struct { backend *eth.Ethereum frontend Frontend @@ -130,9 +133,6 @@ func cTopics(t [][]string) [][]common.Hash { return topics } -func (self *XEth) DefaultGas() *big.Int { return new(big.Int).Set(defaultGas) } -func (self *XEth) DefaultGasPrice() *big.Int { return new(big.Int).Set(defaultGasPrice) } - func (self *XEth) RemoteMining() *miner.RemoteAgent { return self.agent } func (self *XEth) AtStateNum(num int64) *XEth { -- cgit v1.2.3 From 1e28b424e7f0f0d16f467ac7bac08b9dc0384106 Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 2 Apr 2015 14:00:49 +0200 Subject: Default gas --- xeth/xeth.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xeth') diff --git a/xeth/xeth.go b/xeth/xeth.go index cb2319865..13a183832 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -566,11 +566,11 @@ func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr st } if msg.gas.Cmp(big.NewInt(0)) == 0 { - msg.gas = self.DefaultGas() + msg.gas = DefaultGas() } if msg.gasPrice.Cmp(big.NewInt(0)) == 0 { - msg.gasPrice = self.DefaultGasPrice() + msg.gasPrice = DefaultGasPrice() } block := self.CurrentBlock() @@ -616,11 +616,11 @@ func (self *XEth) Transact(fromStr, toStr, valueStr, gasStr, gasPriceStr, codeSt // TODO: align default values to have the same type, e.g. not depend on // common.Value conversions later on if gas.Cmp(big.NewInt(0)) == 0 { - gas = self.DefaultGas() + gas = DefaultGas() } if price.Cmp(big.NewInt(0)) == 0 { - price = self.DefaultGasPrice() + price = DefaultGasPrice() } data = common.FromHex(codeStr) -- cgit v1.2.3