@@ -38,6 +38,7 @@ import (
38
38
"github.com/ava-labs/subnet-evm/accounts/abi/bind"
39
39
"github.com/ava-labs/subnet-evm/core/types"
40
40
"github.com/ava-labs/subnet-evm/interfaces"
41
+ "github.com/ava-labs/subnet-evm/params"
41
42
"github.com/ava-labs/subnet-evm/rpc"
42
43
"github.com/ethereum/go-ethereum/common"
43
44
"github.com/ethereum/go-ethereum/common/hexutil"
69
70
type Client interface {
70
71
Client () * rpc.Client
71
72
Close ()
73
+ ChainConfig (context.Context ) (* params.ChainConfigWithUpgradesJSON , error )
72
74
ChainID (context.Context ) (* big.Int , error )
73
75
BlockByHash (context.Context , common.Hash ) (* types.Block , error )
74
76
BlockByNumber (context.Context , * big.Int ) (* types.Block , error )
@@ -141,6 +143,16 @@ func (ec *client) Client() *rpc.Client {
141
143
142
144
// Blockchain Access
143
145
146
+ // ChainConfig retrieves the current chain config.
147
+ func (ec * client ) ChainConfig (ctx context.Context ) (* params.ChainConfigWithUpgradesJSON , error ) {
148
+ var result * params.ChainConfigWithUpgradesJSON
149
+ err := ec .c .CallContext (ctx , & result , "eth_getChainConfig" )
150
+ if err != nil {
151
+ return nil , err
152
+ }
153
+ return result , err
154
+ }
155
+
144
156
// ChainID retrieves the current chain ID for transaction replay protection.
145
157
func (ec * client ) ChainID (ctx context.Context ) (* big.Int , error ) {
146
158
var result hexutil.Big
0 commit comments