Add protocolVersion API

This commit is contained in:
Nick Johnson 2018-10-16 20:15:27 +01:00
parent 135b7d9f5c
commit 0e6fa8ef86

View file

@ -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 {