Fix "err creating contract" bug.

This commit is contained in:
Joel Burget 2017-09-07 18:56:40 -04:00
parent b11a97d454
commit 1aee2ae53a
2 changed files with 14 additions and 2 deletions

View File

@ -223,18 +223,30 @@ type EthApiState struct {
}
func (s EthApiState) GetBalance(addr common.Address) *big.Int {
if s.privateState.Exist(addr) {
return s.privateState.GetBalance(addr)
}
return s.state.GetBalance(addr)
}
func (s EthApiState) GetCode(addr common.Address) []byte {
if s.privateState.Exist(addr) {
return s.privateState.GetCode(addr)
}
return s.state.GetCode(addr)
}
func (s EthApiState) GetState(a common.Address, b common.Hash) common.Hash {
if s.privateState.Exist(a) {
return s.privateState.GetState(a, b)
}
return s.state.GetState(a, b)
}
func (s EthApiState) GetNonce(addr common.Address) uint64 {
if s.privateState.Exist(addr) {
return s.privateState.GetNonce(addr)
}
return s.state.GetNonce(addr)
}

View File

@ -830,7 +830,7 @@ type RPCTransaction struct {
// newRPCTransaction returns a transaction that will serialize to the RPC
// representation, with the given location metadata set (if available).
func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber uint64, index uint64) *RPCTransaction {
var signer types.Signer = types.FrontierSigner{}
var signer types.Signer = types.HomesteadSigner{}
if tx.Protected() {
signer = types.NewEIP155Signer(tx.ChainId())
}
@ -1000,7 +1000,7 @@ func (s *PublicTransactionPoolAPI) GetTransactionReceipt(hash common.Hash) (map[
}
receipt, _, _, _ := core.GetReceipt(s.b.ChainDb(), hash) // Old receipts don't have the lookup data available
var signer types.Signer = types.FrontierSigner{}
var signer types.Signer = types.HomesteadSigner{}
if tx.Protected() {
signer = types.NewEIP155Signer(tx.ChainId())
}