Update eth_call code.

This commit is contained in:
Arijit Das
2021-09-29 10:57:11 +05:30
parent 0f2b6fd843
commit cc6822f7a6
5 changed files with 207 additions and 131 deletions
+9 -5
View File
@@ -835,16 +835,20 @@ func (b *Block) Call(ctx context.Context, args struct {
return nil, err
}
}
result, gas, failed, err := eth.DoCall(ctx, b.backend, args.Data, *b.numberOrHash, nil, 5*time.Second, b.backend.RPCGasCap())
result, err := eth.DoCall(ctx, b.backend, args.Data, *b.numberOrHash, nil, 5*time.Second, b.backend.RPCGasCap().Uint64())
if err != nil {
return nil, err
}
status := hexutil.Uint64(1)
if failed {
if result.Failed() {
status = 0
}
return &CallResult{
data: hexutil.Bytes(result),
gasUsed: hexutil.Uint64(gas),
data: result.ReturnData,
gasUsed: hexutil.Uint64(result.UsedGas),
status: status,
}, err
}, nil
}
// Resolver is the top-level object in the GraphQL hierarchy.