From 0e6fa8ef86d810cd724a7976b93049378979f03e Mon Sep 17 00:00:00 2001 From: Nick Johnson Date: Tue, 16 Oct 2018 20:15:27 +0100 Subject: [PATCH] Add protocolVersion API --- ethgraphql/main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ethgraphql/main.go b/ethgraphql/main.go index 89c778187d..cde9002f40 100644 --- a/ethgraphql/main.go +++ b/ethgraphql/main.go @@ -1022,6 +1022,15 @@ func (r *Resolver) GasPrice(ctx context.Context) (hexutil.Big, error) { return hexutil.Big(*price), err } +func (r *Resolver) ProtocolVersion(ctx context.Context) (int32, error) { + be, err := getBackend(r.node) + if err != nil { + return 0, err + } + + return int32(be.ProtocolVersion()), nil +} + func NewHandler(n *node.Node) (http.Handler, error) { q := Resolver{n} @@ -1135,6 +1144,7 @@ func NewHandler(n *node.Node) (http.Handler, error) { estimateGas(data: CallData!, blockNumber: Long): Long! logs(filter: FilterCriteria!): [Log!]! gasPrice: BigInt! + protocolVersion: Int! } type Mutation {