forked from cerc-io/plugeth
xeth: set balance max balance to from in call. Closes #951
This commit is contained in:
parent
d116b9595c
commit
79fa05867f
@ -13,6 +13,7 @@ var (
|
|||||||
Big32 = big.NewInt(32)
|
Big32 = big.NewInt(32)
|
||||||
Big256 = big.NewInt(0xff)
|
Big256 = big.NewInt(0xff)
|
||||||
Big257 = big.NewInt(257)
|
Big257 = big.NewInt(257)
|
||||||
|
MaxBig = String2Big("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")
|
||||||
)
|
)
|
||||||
|
|
||||||
// Big pow
|
// Big pow
|
||||||
|
@ -778,7 +778,7 @@ func (self *XEth) PushTx(encodedTx string) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr string) (string, string, error) {
|
func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr string) (string, string, error) {
|
||||||
statedb := self.State().State() //self.eth.ChainManager().TransState()
|
statedb := self.State().State().Copy() //self.eth.ChainManager().TransState()
|
||||||
var from *state.StateObject
|
var from *state.StateObject
|
||||||
if len(fromStr) == 0 {
|
if len(fromStr) == 0 {
|
||||||
accounts, err := self.backend.AccountManager().Accounts()
|
accounts, err := self.backend.AccountManager().Accounts()
|
||||||
@ -791,6 +791,7 @@ func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr st
|
|||||||
from = statedb.GetOrNewStateObject(common.HexToAddress(fromStr))
|
from = statedb.GetOrNewStateObject(common.HexToAddress(fromStr))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
from.SetBalance(common.MaxBig)
|
||||||
from.SetGasPool(self.backend.ChainManager().GasLimit())
|
from.SetGasPool(self.backend.ChainManager().GasLimit())
|
||||||
msg := callmsg{
|
msg := callmsg{
|
||||||
from: from,
|
from: from,
|
||||||
|
Loading…
Reference in New Issue
Block a user