Skip to content

Commit 936ddf2

Browse files
committed
Merge pull request bnb-chain#616 from bas-vk/develop
Frontier/513
2 parents dba9b83 + 1559bd9 commit 936ddf2

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎xeth/xeth.go‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ func cTopics(t [][]string) [][]common.Hash {
129129
return topics
130130
}
131131

132-
func (self *XEth) DefaultGas() *big.Int { return defaultGas }
133-
func (self *XEth) DefaultGasPrice() *big.Int { return defaultGasPrice }
132+
func (self *XEth) DefaultGas() *big.Int { return new(big.Int).Set(defaultGas) }
133+
func (self *XEth) DefaultGasPrice() *big.Int { return new(big.Int).Set(defaultGasPrice) }
134134

135135
func (self *XEth) RemoteMining() *miner.RemoteAgent { return self.agent }
136136

@@ -565,12 +565,13 @@ func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr st
565565
value: common.Big(valueStr),
566566
data: common.FromHex(dataStr),
567567
}
568+
568569
if msg.gas.Cmp(big.NewInt(0)) == 0 {
569-
msg.gas = defaultGas
570+
msg.gas = self.DefaultGas()
570571
}
571572

572573
if msg.gasPrice.Cmp(big.NewInt(0)) == 0 {
573-
msg.gasPrice = defaultGasPrice
574+
msg.gasPrice = self.DefaultGasPrice()
574575
}
575576

576577
block := self.CurrentBlock()
@@ -616,11 +617,11 @@ func (self *XEth) Transact(fromStr, toStr, valueStr, gasStr, gasPriceStr, codeSt
616617
// TODO: align default values to have the same type, e.g. not depend on
617618
// common.Value conversions later on
618619
if gas.Cmp(big.NewInt(0)) == 0 {
619-
gas = defaultGas
620+
gas = self.DefaultGas()
620621
}
621622

622623
if price.Cmp(big.NewInt(0)) == 0 {
623-
price = defaultGasPrice
624+
price = self.DefaultGasPrice()
624625
}
625626

626627
data = common.FromHex(codeStr)

0 commit comments

Comments
 (0)