aboutsummaryrefslogtreecommitdiffstats
path: root/graphql
diff options
context:
space:
mode:
authorgary rong <garyrong0905@gmail.com>2019-08-08 21:44:11 +0800
committerPéter Szilágyi <peterke@gmail.com>2019-08-08 21:44:11 +0800
commitc9cdf144d55f6bbd75314e812eeefc18d7e8c40e (patch)
treee392f3130a4ef56398a2dc164f98e82001d0d162 /graphql
parent081642ed255fd939ec186f97fd60a316b51d8b61 (diff)
downloadgo-tangerine-c9cdf144d55f6bbd75314e812eeefc18d7e8c40e.tar
go-tangerine-c9cdf144d55f6bbd75314e812eeefc18d7e8c40e.tar.gz
go-tangerine-c9cdf144d55f6bbd75314e812eeefc18d7e8c40e.tar.bz2
go-tangerine-c9cdf144d55f6bbd75314e812eeefc18d7e8c40e.tar.lz
go-tangerine-c9cdf144d55f6bbd75314e812eeefc18d7e8c40e.tar.xz
go-tangerine-c9cdf144d55f6bbd75314e812eeefc18d7e8c40e.tar.zst
go-tangerine-c9cdf144d55f6bbd75314e812eeefc18d7e8c40e.zip
graphql, internal/ethapi: support overriding accounts in eth_call (#19917)
* graphql, internal/ethapi: extend eth_call This PR offers the third option parameter for eth_call API. Caller can specify a batch of contracts for overriding the original account metadata(nonce, balance, code, state). It has a few advantages: * It's friendly for debugging * It's can make on-chain contract lighter for getting rid of state access functions * core, internal: address comments
Diffstat (limited to 'graphql')
-rw-r--r--graphql/graphql.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/graphql/graphql.go b/graphql/graphql.go
index 771c3c62f..df279f42b 100644
--- a/graphql/graphql.go
+++ b/graphql/graphql.go
@@ -817,7 +817,7 @@ func (b *Block) Call(ctx context.Context, args struct {
return nil, err
}
}
- result, gas, failed, err := ethapi.DoCall(ctx, b.backend, args.Data, *b.num, vm.Config{}, 5*time.Second, b.backend.RPCGasCap())
+ result, gas, failed, err := ethapi.DoCall(ctx, b.backend, args.Data, *b.num, nil, vm.Config{}, 5*time.Second, b.backend.RPCGasCap())
status := hexutil.Uint64(1)
if failed {
status = 0
@@ -885,7 +885,7 @@ func (p *Pending) Account(ctx context.Context, args struct {
func (p *Pending) Call(ctx context.Context, args struct {
Data ethapi.CallArgs
}) (*CallResult, error) {
- result, gas, failed, err := ethapi.DoCall(ctx, p.backend, args.Data, rpc.PendingBlockNumber, vm.Config{}, 5*time.Second, p.backend.RPCGasCap())
+ result, gas, failed, err := ethapi.DoCall(ctx, p.backend, args.Data, rpc.PendingBlockNumber, nil, vm.Config{}, 5*time.Second, p.backend.RPCGasCap())
status := hexutil.Uint64(1)
if failed {
status = 0