mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
graphql: add support for retrieving the chain id (#21451)
This commit is contained in:
parent
0dfcc3f6f8
commit
1fc802e7a7
@ -1048,6 +1048,10 @@ func (r *Resolver) ProtocolVersion(ctx context.Context) (int32, error) {
|
||||
return int32(r.backend.ProtocolVersion()), nil
|
||||
}
|
||||
|
||||
func (r *Resolver) ChainID(ctx context.Context) (hexutil.Big, error) {
|
||||
return hexutil.Big(*r.backend.ChainConfig().ChainID), nil
|
||||
}
|
||||
|
||||
// SyncState represents the synchronisation status returned from the `syncing` accessor.
|
||||
type SyncState struct {
|
||||
progress ethereum.SyncProgress
|
||||
|
@ -314,6 +314,8 @@ const schema string = `
|
||||
protocolVersion: Int!
|
||||
# Syncing returns information on the current synchronisation state.
|
||||
syncing: SyncState
|
||||
# ChainID returns the current chain ID for transaction replay protection.
|
||||
chainID: BigInt!
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
|
Loading…
Reference in New Issue
Block a user