aboutsummaryrefslogtreecommitdiffstats
path: root/xeth
diff options
context:
space:
mode:
authorBas van Kervel <basvankervel@ziggo.nl>2015-04-01 18:33:12 +0800
committerBas van Kervel <basvankervel@ziggo.nl>2015-04-01 18:33:12 +0800
commit6605d00d92c029a46f624d3f295758f62c3dddd4 (patch)
treef78dae92dc2c728f0d42f0e0d39595dcd11af639 /xeth
parent4e8f8cfab701bb6c4ad2b8cf166d642f408ca398 (diff)
downloadgo-tangerine-6605d00d92c029a46f624d3f295758f62c3dddd4.tar
go-tangerine-6605d00d92c029a46f624d3f295758f62c3dddd4.tar.gz
go-tangerine-6605d00d92c029a46f624d3f295758f62c3dddd4.tar.bz2
go-tangerine-6605d00d92c029a46f624d3f295758f62c3dddd4.tar.lz
go-tangerine-6605d00d92c029a46f624d3f295758f62c3dddd4.tar.xz
go-tangerine-6605d00d92c029a46f624d3f295758f62c3dddd4.tar.zst
go-tangerine-6605d00d92c029a46f624d3f295758f62c3dddd4.zip
Frontier/513
Diffstat (limited to 'xeth')
-rw-r--r--xeth/xeth.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 7e1548964..7f0c04a12 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -128,8 +128,8 @@ func cTopics(t [][]string) [][]common.Hash {
return topics
}
-func (self *XEth) DefaultGas() *big.Int { return defaultGas }
-func (self *XEth) DefaultGasPrice() *big.Int { return defaultGasPrice }
+func (self *XEth) DefaultGas() *big.Int { return big.NewInt(defaultGas.Int64()) }
+func (self *XEth) DefaultGasPrice() *big.Int { return big.NewInt(defaultGasPrice.Int64()) }
func (self *XEth) RemoteMining() *miner.RemoteAgent { return self.agent }
@@ -547,12 +547,13 @@ func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr st
value: common.Big(valueStr),
data: common.FromHex(dataStr),
}
+
if msg.gas.Cmp(big.NewInt(0)) == 0 {
- msg.gas = defaultGas
+ msg.gas = self.DefaultGas()
}
if msg.gasPrice.Cmp(big.NewInt(0)) == 0 {
- msg.gasPrice = defaultGasPrice
+ msg.gasPrice = self.DefaultGasPrice()
}
block := self.CurrentBlock()
@@ -598,11 +599,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 = defaultGas
+ gas = self.DefaultGas()
}
if price.Cmp(big.NewInt(0)) == 0 {
- price = defaultGasPrice
+ price = self.DefaultGasPrice()
}
data = common.FromHex(codeStr)