From 0c6f81f8888d1045faa29de292f37d9bbfb6b4ff Mon Sep 17 00:00:00 2001 From: "lightclient@protonmail.com" Date: Wed, 15 Jun 2022 10:39:07 +0200 Subject: [PATCH] all: remove version field from rpc.API --- cmd/clef/main.go | 2 +- consensus/clique/clique.go | 1 - consensus/ethash/ethash.go | 2 -- eth/backend.go | 7 ------- eth/catalyst/api.go | 1 - eth/tracers/api.go | 1 - internal/ethapi/backend.go | 7 ------- les/catalyst/api.go | 1 - les/client.go | 6 ------ les/server.go | 3 --- node/api.go | 3 --- node/utils_test.go | 3 --- p2p/simulations/adapters/exec.go | 1 - rpc/types.go | 2 +- 14 files changed, 2 insertions(+), 38 deletions(-) diff --git a/cmd/clef/main.go b/cmd/clef/main.go index 1a18cd16a..850d2b82d 100644 --- a/cmd/clef/main.go +++ b/cmd/clef/main.go @@ -648,7 +648,7 @@ func signer(c *cli.Context) error { { Namespace: "account", Service: api, - Version: "1.0"}, + }, } if c.GlobalBool(utils.HTTPEnabledFlag.Name) { vhosts := utils.SplitAndTrim(c.GlobalString(utils.HTTPVirtualHostsFlag.Name)) diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index f229d0426..dcdfb20c6 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -697,7 +697,6 @@ func (c *Clique) Close() error { func (c *Clique) APIs(chain consensus.ChainHeaderReader) []rpc.API { return []rpc.API{{ Namespace: "clique", - Version: "1.0", Service: &API{chain: chain, clique: c}, }} } diff --git a/consensus/ethash/ethash.go b/consensus/ethash/ethash.go index 902949202..0efb3590f 100644 --- a/consensus/ethash/ethash.go +++ b/consensus/ethash/ethash.go @@ -678,12 +678,10 @@ func (ethash *Ethash) APIs(chain consensus.ChainHeaderReader) []rpc.API { return []rpc.API{ { Namespace: "eth", - Version: "1.0", Service: &API{ethash}, }, { Namespace: "ethash", - Version: "1.0", Service: &API{ethash}, }, } diff --git a/eth/backend.go b/eth/backend.go index b4bea088f..b16ce4b54 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -308,31 +308,24 @@ func (s *Ethereum) APIs() []rpc.API { return append(apis, []rpc.API{ { Namespace: "eth", - Version: "1.0", Service: NewEthereumAPI(s), }, { Namespace: "miner", - Version: "1.0", Service: NewMinerAPI(s), }, { Namespace: "eth", - Version: "1.0", Service: downloader.NewDownloaderAPI(s.handler.downloader, s.eventMux), }, { Namespace: "eth", - Version: "1.0", Service: filters.NewFilterAPI(s.APIBackend, false, 5*time.Minute), }, { Namespace: "admin", - Version: "1.0", Service: NewAdminAPI(s), }, { Namespace: "debug", - Version: "1.0", Service: NewDebugAPI(s), }, { Namespace: "net", - Version: "1.0", Service: s.netRPCService, }, }...) diff --git a/eth/catalyst/api.go b/eth/catalyst/api.go index acc9c0e66..552d5d1d8 100644 --- a/eth/catalyst/api.go +++ b/eth/catalyst/api.go @@ -42,7 +42,6 @@ func Register(stack *node.Node, backend *eth.Ethereum) error { stack.RegisterAPIs([]rpc.API{ { Namespace: "engine", - Version: "1.0", Service: NewConsensusAPI(backend), Authenticated: true, }, diff --git a/eth/tracers/api.go b/eth/tracers/api.go index b0f30567f..4041b1770 100644 --- a/eth/tracers/api.go +++ b/eth/tracers/api.go @@ -918,7 +918,6 @@ func APIs(backend Backend) []rpc.API { return []rpc.API{ { Namespace: "debug", - Version: "1.0", Service: NewAPI(backend), }, } diff --git a/internal/ethapi/backend.go b/internal/ethapi/backend.go index 5119be859..d13547f23 100644 --- a/internal/ethapi/backend.go +++ b/internal/ethapi/backend.go @@ -101,31 +101,24 @@ func GetAPIs(apiBackend Backend) []rpc.API { return []rpc.API{ { Namespace: "eth", - Version: "1.0", Service: NewEthereumAPI(apiBackend), }, { Namespace: "eth", - Version: "1.0", Service: NewBlockChainAPI(apiBackend), }, { Namespace: "eth", - Version: "1.0", Service: NewTransactionAPI(apiBackend, nonceLock), }, { Namespace: "txpool", - Version: "1.0", Service: NewTxPoolAPI(apiBackend), }, { Namespace: "debug", - Version: "1.0", Service: NewDebugAPI(apiBackend), }, { Namespace: "eth", - Version: "1.0", Service: NewEthereumAccountAPI(apiBackend.AccountManager()), }, { Namespace: "personal", - Version: "1.0", Service: NewPersonalAccountAPI(apiBackend, nonceLock), }, } diff --git a/les/catalyst/api.go b/les/catalyst/api.go index 12d210613..9c2d17c79 100644 --- a/les/catalyst/api.go +++ b/les/catalyst/api.go @@ -35,7 +35,6 @@ func Register(stack *node.Node, backend *les.LightEthereum) error { stack.RegisterAPIs([]rpc.API{ { Namespace: "engine", - Version: "1.0", Service: NewConsensusAPI(backend), Authenticated: true, }, diff --git a/les/client.go b/les/client.go index 97a333ab9..44eaffec2 100644 --- a/les/client.go +++ b/les/client.go @@ -294,27 +294,21 @@ func (s *LightEthereum) APIs() []rpc.API { return append(apis, []rpc.API{ { Namespace: "eth", - Version: "1.0", Service: &LightDummyAPI{}, }, { Namespace: "eth", - Version: "1.0", Service: downloader.NewDownloaderAPI(s.handler.downloader, s.eventMux), }, { Namespace: "eth", - Version: "1.0", Service: filters.NewFilterAPI(s.ApiBackend, true, 5*time.Minute), }, { Namespace: "net", - Version: "1.0", Service: s.netRPCService, }, { Namespace: "les", - Version: "1.0", Service: NewLightAPI(&s.lesCommons), }, { Namespace: "vflux", - Version: "1.0", Service: s.serverPool.API(), }, }...) diff --git a/les/server.go b/les/server.go index 894fc1383..df453b481 100644 --- a/les/server.go +++ b/les/server.go @@ -159,17 +159,14 @@ func (s *LesServer) APIs() []rpc.API { return []rpc.API{ { Namespace: "les", - Version: "1.0", Service: NewLightAPI(&s.lesCommons), }, { Namespace: "les", - Version: "1.0", Service: NewLightServerAPI(s), }, { Namespace: "debug", - Version: "1.0", Service: NewDebugAPI(s), }, } diff --git a/node/api.go b/node/api.go index b395a345c..67953a812 100644 --- a/node/api.go +++ b/node/api.go @@ -35,15 +35,12 @@ func (n *Node) apis() []rpc.API { return []rpc.API{ { Namespace: "admin", - Version: "1.0", Service: &adminAPI{n}, }, { Namespace: "debug", - Version: "1.0", Service: debug.Handler, }, { Namespace: "web3", - Version: "1.0", Service: &web3API{n}, }, } diff --git a/node/utils_test.go b/node/utils_test.go index 31dbe911b..681f3a8b2 100644 --- a/node/utils_test.go +++ b/node/utils_test.go @@ -95,15 +95,12 @@ func (f *FullService) APIs() []rpc.API { return []rpc.API{ { Namespace: "admin", - Version: "1.0", }, { Namespace: "debug", - Version: "1.0", }, { Namespace: "net", - Version: "1.0", }, } } diff --git a/p2p/simulations/adapters/exec.go b/p2p/simulations/adapters/exec.go index 35ccdfb06..7bfa8aab6 100644 --- a/p2p/simulations/adapters/exec.go +++ b/p2p/simulations/adapters/exec.go @@ -501,7 +501,6 @@ func startExecNodeStack() (*node.Node, error) { // Add the snapshot API. stack.RegisterAPIs([]rpc.API{{ Namespace: "simulation", - Version: "1.0", Service: SnapshotAPI{services}, }}) diff --git a/rpc/types.go b/rpc/types.go index a0d742f49..369e950aa 100644 --- a/rpc/types.go +++ b/rpc/types.go @@ -31,7 +31,7 @@ import ( // API describes the set of methods offered over the RPC interface type API struct { Namespace string // namespace under which the rpc methods of Service are exposed - Version string // api version for DApp's + Version string // deprecated - this field is no longer used, but retained for compatibility Service interface{} // receiver instance which holds the methods Public bool // deprecated - this field is no longer used, but retained for compatibility Authenticated bool // whether the api should only be available behind authentication.