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{ return []rpc.API{
{ {
Namespace: ProtocolName, Namespace: ProtocolName,
Version: ProtocolVersionStr,
Service: NewPublicXDCXAPI(XDCx), Service: NewPublicXDCXAPI(XDCx),
}, },
} }

View file

@ -90,7 +90,6 @@ func (l *Lending) APIs() []rpc.API {
return []rpc.API{ return []rpc.API{
{ {
Namespace: ProtocolName, Namespace: ProtocolName,
Version: ProtocolVersionStr,
Service: NewPublicXDCXLendingAPI(l), 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 { func (x *XDPoS) APIs(chain consensus.ChainReader) []rpc.API {
return []rpc.API{{ return []rpc.API{{
Namespace: "XDPoS", Namespace: "XDPoS",
Version: "1.0",
Service: &API{chain: chain, XDPoS: x}, 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 { func (c *Clique) APIs(chain consensus.ChainReader) []rpc.API {
return []rpc.API{{ return []rpc.API{{
Namespace: "clique", Namespace: "clique",
Version: "1.0",
Service: &API{chain: chain, clique: c}, Service: &API{chain: chain, clique: c},
}} }}
} }

View file

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

View file

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

View file

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

View file

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

View file

@ -30,7 +30,7 @@ import (
// API describes the set of methods offered over the RPC interface // API describes the set of methods offered over the RPC interface
type API struct { type API struct {
Namespace string // namespace under which the rpc methods of Service are exposed 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 Service interface{} // receiver instance which holds the methods
Public bool // deprecated - this field is no longer used, but retained for compatibility Public bool // deprecated - this field is no longer used, but retained for compatibility
} }