diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-05-20 17:29:28 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2016-05-24 15:33:15 +0800 |
commit | 1776c717bfb540f95e1b2233f35ea6f4cc8f57d5 (patch) | |
tree | 5926f97eb049e55d7aeb8cb338bf1b9f0892d008 /eth/api.go | |
parent | 0f6e3e873ab378e8ef997adcf5b0a0d78b6c90cc (diff) | |
download | go-tangerine-1776c717bfb540f95e1b2233f35ea6f4cc8f57d5.tar go-tangerine-1776c717bfb540f95e1b2233f35ea6f4cc8f57d5.tar.gz go-tangerine-1776c717bfb540f95e1b2233f35ea6f4cc8f57d5.tar.bz2 go-tangerine-1776c717bfb540f95e1b2233f35ea6f4cc8f57d5.tar.lz go-tangerine-1776c717bfb540f95e1b2233f35ea6f4cc8f57d5.tar.xz go-tangerine-1776c717bfb540f95e1b2233f35ea6f4cc8f57d5.tar.zst go-tangerine-1776c717bfb540f95e1b2233f35ea6f4cc8f57d5.zip |
[release 1.4.5] accounts/abi/bind, eth: rely on getCode for sanity checks, not estimate and call
(cherry picked from commit 1580ec180414bce1e37acc614bc2445f778efb75)
Diffstat (limited to 'eth/api.go')
-rw-r--r-- | eth/api.go | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/eth/api.go b/eth/api.go index 06f4d5de0..d048904f3 100644 --- a/eth/api.go +++ b/eth/api.go @@ -52,15 +52,6 @@ import ( "golang.org/x/net/context" ) -// errNoCode is returned by call and transact operations for which the requested -// recipient contract to operate on does not exist in the state db or does not -// have any code associated with it (i.e. suicided). -// -// Please note, this error string is part of the RPC API and is expected by the -// native contract bindings to signal this particular error. Do not change this -// as it will break all dependent code! -var errNoCode = errors.New("no contract code at given address") - const defaultGas = uint64(90000) // blockByNumber is a commonly used helper function which retrieves and returns @@ -755,12 +746,6 @@ func (s *PublicBlockChainAPI) doCall(args CallArgs, blockNr rpc.BlockNumber) (st } stateDb = stateDb.Copy() - // If there's no code to interact with, respond with an appropriate error - if args.To != nil { - if code := stateDb.GetCode(*args.To); len(code) == 0 { - return "0x", nil, errNoCode - } - } // Retrieve the account state object to interact with var from *state.StateObject if args.From == (common.Address{}) { |