Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions chains.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ chain-settings:
label: Avalanche
type: eth
settings:
method-spec: "avalanche"
expected-block-time: 2s
allow-pruning-requirement: true
options:
Expand Down
2 changes: 1 addition & 1 deletion docs/method-specs.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ Grouped by the transports they declare:

| `api-connectors` | Specs |
| --- | --- |
| `json-rpc`, `websocket` | `arbitrum`, `avail`, `cronos_zkevm`, `eth-json-rpc`, `fantom`, `filecoin`, `harmony_0`, `harmony_1`, `hyperliquid-eth`, `klaytn-json-rpc`, `linea`, `mantle`, `optimism`, `polkadot-json-rpc`, `polygon`, `polygon_zkevm`, `rootstock`, `scroll`, `sei`, `solana-json-rpc`, `viction`, `zk` |
| `json-rpc`, `websocket` | `arbitrum`, `avail`, `avalanche`, `cronos_zkevm`, `eth-json-rpc`, `fantom`, `filecoin`, `harmony_0`, `harmony_1`, `hyperliquid-eth`, `klaytn-json-rpc`, `linea`, `mantle`, `optimism`, `polkadot-json-rpc`, `polygon`, `polygon_zkevm`, `rootstock`, `scroll`, `sei`, `solana-json-rpc`, `viction`, `zk` |
| `json-rpc` | `algorand-json-rpc`, `aztec`, `bitcoin-json-rpc`, `celestia-json-rpc`, `near-json-rpc`, `starknet-json-rpc`, `stellar-json-rpc`, `tron-json-rpc` |
| `websocket` | `eth-websocket`, `klaytn-websocket`, `polkadot-websocket`, `solana-websocket` |
| `tendermint` | `cosmos-tendermint` |
Expand Down
17 changes: 17 additions & 0 deletions pkg/methods/methods_spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,23 @@ func TestAlgorandSpecLoads(t *testing.T) {
assert.Equal(t, []string{"12345"}, params)
}

func TestAvalancheSpecLoads(t *testing.T) {
err := specs.NewMethodSpecLoader().Load()
assert.NoError(t, err)

// avalanche's own extension method is available...
spec := specs.GetSpecMethod("avalanche", "eth_baseFee")
assert.NotNil(t, spec)
assert.False(t, spec.IsCacheable())

// ...on top of every method the imported `eth` spec already provides.
spec = specs.GetSpecMethod("avalanche", "eth_blockNumber")
assert.NotNil(t, spec)

spec = specs.GetSpecMethod("avalanche", "ftm_effectiveBaseFee")
assert.Nil(t, spec)
}

func TestLoadSpecGrpcDefaults(t *testing.T) {
err := specs.NewMethodSpecLoaderWithFs(os.DirFS("test_specs/grpc")).Load()
assert.NoError(t, err)
Expand Down
27 changes: 27 additions & 0 deletions pkg/methods/specs/avalanche.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"openrpc": "1.0.0",
"info": {
"title": "Avalanche C-Chain JSON-RPC methods",
"version": "1.0.0"
},
"spec": {
"name": "avalanche",
"api-connectors": [
"json-rpc",
"websocket"
],
"type": "plain"
},
"spec-imports": [
"eth"
],
"methods": [
{
"name": "eth_baseFee",
"settings": {
"cacheable": false
},
"params": []
}
]
}