Skip to content

Commit d2fe42b

Browse files
colinlyguos1na
andauthored
internal/ethapi: eth_call block parameter is optional (ethereum#28165) (#1095)
* internal/ethapi: eth_call block parameter is optional (ethereum#28165) So apparently in the spec the base block parameter of eth_call is optional. I agree that "latest" is a sane default for this that most people would use. * chore: auto version bump [bot] --------- Co-authored-by: Sina Mahmoodi <[email protected]> Co-authored-by: colinlyguo <[email protected]>
1 parent 9fff27e commit d2fe42b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

internal/ethapi/api.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,8 +1087,12 @@ func (e *revertError) ErrorData() interface{} {
10871087
//
10881088
// Note, this function doesn't make and changes in the state/blockchain and is
10891089
// useful to execute and retrieve values.
1090-
func (s *PublicBlockChainAPI) Call(ctx context.Context, args TransactionArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *StateOverride) (hexutil.Bytes, error) {
1091-
result, err := DoCall(ctx, s.b, args, blockNrOrHash, overrides, s.b.RPCEVMTimeout(), s.b.RPCGasCap())
1090+
func (s *PublicBlockChainAPI) Call(ctx context.Context, args TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash, overrides *StateOverride) (hexutil.Bytes, error) {
1091+
if blockNrOrHash == nil {
1092+
latest := rpc.BlockNumberOrHashWithNumber(rpc.LatestBlockNumber)
1093+
blockNrOrHash = &latest
1094+
}
1095+
result, err := DoCall(ctx, s.b, args, *blockNrOrHash, overrides, s.b.RPCEVMTimeout(), s.b.RPCGasCap())
10921096
if err != nil {
10931097
return nil, err
10941098
}

params/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
const (
2525
VersionMajor = 5 // Major version component of the current release
2626
VersionMinor = 7 // Minor version component of the current release
27-
VersionPatch = 25 // Patch version component of the current release
27+
VersionPatch = 26 // Patch version component of the current release
2828
VersionMeta = "mainnet" // Version metadata to append to the version string
2929
)
3030

0 commit comments

Comments
 (0)