all: remove version field #25096 (#970)

This commit is contained in:
Daniel Liu 2025-04-24 18:55:15 +08:00 committed by GitHub
parent 4fb622bfd0
commit 94b3ca1eeb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 1 additions and 28 deletions

View file

@ -144,7 +144,6 @@ func (XDCx *XDCX) APIs() []rpc.API {
return []rpc.API{
{
Namespace: ProtocolName,
Version: ProtocolVersionStr,
Service: NewPublicXDCXAPI(XDCx),
},
}

View file

@ -90,7 +90,6 @@ func (l *Lending) APIs() []rpc.API {
return []rpc.API{
{
Namespace: ProtocolName,
Version: ProtocolVersionStr,
Service: NewPublicXDCXLendingAPI(l),
},
}

View file

@ -174,7 +174,6 @@ func (x *XDPoS) Initial(chain consensus.ChainReader, header *types.Header) error
func (x *XDPoS) APIs(chain consensus.ChainReader) []rpc.API {
return []rpc.API{{
Namespace: "XDPoS",
Version: "1.0",
Service: &API{chain: chain, XDPoS: x},
}}
}

View file

@ -693,7 +693,6 @@ func CalcDifficulty(snap *Snapshot, signer common.Address) *big.Int {
func (c *Clique) APIs(chain consensus.ChainReader) []rpc.API {
return []rpc.API{{
Namespace: "clique",
Version: "1.0",
Service: &API{chain: chain, clique: c},
}}
}

View file

@ -400,39 +400,30 @@ func (e *Ethereum) APIs() []rpc.API {
return append(apis, []rpc.API{
{
Namespace: "eth",
Version: "1.0",
Service: NewPublicEthereumAPI(e),
}, {
Namespace: "eth",
Version: "1.0",
Service: NewPublicMinerAPI(e),
}, {
Namespace: "eth",
Version: "1.0",
Service: downloader.NewPublicDownloaderAPI(e.protocolManager.downloader, e.eventMux),
}, {
Namespace: "miner",
Version: "1.0",
Service: NewPrivateMinerAPI(e),
}, {
Namespace: "eth",
Version: "1.0",
Service: filters.NewFilterAPI(filters.NewFilterSystem(e.ApiBackend, filters.Config{LogCacheSize: e.config.FilterLogCacheSize}), false),
}, {
Namespace: "admin",
Version: "1.0",
Service: NewPrivateAdminAPI(e),
}, {
Namespace: "debug",
Version: "1.0",
Service: NewPublicDebugAPI(e),
}, {
Namespace: "debug",
Version: "1.0",
Service: NewPrivateDebugAPI(e.chainConfig, e),
}, {
Namespace: "net",
Version: "1.0",
Service: e.netRPCService,
},
}...)

View file

@ -124,39 +124,30 @@ func GetAPIs(apiBackend Backend, chainReader consensus.ChainReader) []rpc.API {
return []rpc.API{
{
Namespace: "eth",
Version: "1.0",
Service: NewPublicEthereumAPI(apiBackend),
}, {
Namespace: "eth",
Version: "1.0",
Service: NewPublicBlockChainAPI(apiBackend, chainReader),
}, {
Namespace: "eth",
Version: "1.0",
Service: NewPublicTransactionPoolAPI(apiBackend, nonceLock),
}, {
Namespace: "XDCx",
Version: "1.0",
Service: NewPublicXDCXTransactionPoolAPI(apiBackend, nonceLock),
}, {
Namespace: "txpool",
Version: "1.0",
Service: NewPublicTxPoolAPI(apiBackend),
}, {
Namespace: "debug",
Version: "1.0",
Service: NewPublicDebugAPI(apiBackend),
}, {
Namespace: "debug",
Version: "1.0",
Service: NewPrivateDebugAPI(apiBackend),
}, {
Namespace: "eth",
Version: "1.0",
Service: NewPublicAccountAPI(apiBackend.AccountManager()),
}, {
Namespace: "personal",
Version: "1.0",
Service: NewPrivateAccountAPI(apiBackend, nonceLock),
},
}

View file

@ -34,19 +34,15 @@ func (n *Node) apis() []rpc.API {
return []rpc.API{
{
Namespace: "admin",
Version: "1.0",
Service: &privateAdminAPI{n},
}, {
Namespace: "admin",
Version: "1.0",
Service: &publicAdminAPI{n},
}, {
Namespace: "debug",
Version: "1.0",
Service: debug.Handler,
}, {
Namespace: "web3",
Version: "1.0",
Service: &publicWeb3API{n},
},
}

View file

@ -452,7 +452,6 @@ func execP2PNode() {
// Add the snapshot API.
stack.RegisterAPIs([]rpc.API{{
Namespace: "simulation",
Version: "1.0",
Service: SnapshotAPI{services},
}})

View file

@ -30,7 +30,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
}