aboutsummaryrefslogtreecommitdiffstats
path: root/xeth/xeth.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-04-04 19:24:21 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-04-04 19:24:21 +0800
commit47298264663a563b34ebb8a1faf9fb8326fdef01 (patch)
treea8d42be85553fbb057cc47356d85cfea24d6832b /xeth/xeth.go
parent3e042317adc99438d6ffde0cbde4f0b40ad579c1 (diff)
parentbc5528b165e48e223c9c38dc1355511014c97e34 (diff)
downloaddexon-47298264663a563b34ebb8a1faf9fb8326fdef01.tar
dexon-47298264663a563b34ebb8a1faf9fb8326fdef01.tar.gz
dexon-47298264663a563b34ebb8a1faf9fb8326fdef01.tar.bz2
dexon-47298264663a563b34ebb8a1faf9fb8326fdef01.tar.lz
dexon-47298264663a563b34ebb8a1faf9fb8326fdef01.tar.xz
dexon-47298264663a563b34ebb8a1faf9fb8326fdef01.tar.zst
dexon-47298264663a563b34ebb8a1faf9fb8326fdef01.zip
Merge branch 'develop' into rpcfabian
Diffstat (limited to 'xeth/xeth.go')
-rw-r--r--xeth/xeth.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index ad6b09b54..825f26017 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 {
@@ -572,11 +572,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()
@@ -622,11 +622,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)