eth, internal/ethapi: remove order tx pool API (#1743)

This commit is contained in:
Daniel Liu 2025-11-15 19:15:05 +08:00 committed by GitHub
parent 650047c81e
commit a75a1467ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 0 additions and 69 deletions

View file

@ -304,16 +304,6 @@ func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction)
return b.eth.txPool.AddLocal(signedTx)
}
// SendOrderTx send order via backend
func (b *EthAPIBackend) SendOrderTx(ctx context.Context, signedTx *types.OrderTransaction) error {
return b.eth.orderPool.AddLocal(signedTx)
}
// SendLendingTx send order via backend
func (b *EthAPIBackend) SendLendingTx(ctx context.Context, signedTx *types.LendingTransaction) error {
return b.eth.lendingPool.AddLocal(signedTx)
}
func (b *EthAPIBackend) GetPoolTransactions() (types.Transactions, error) {
pending := b.eth.txPool.Pending(false)
var txs types.Transactions
@ -348,10 +338,6 @@ func (b *EthAPIBackend) TxPoolContentFrom(addr common.Address) (types.Transactio
return b.eth.TxPool().ContentFrom(addr)
}
func (b *EthAPIBackend) OrderTxPoolContent() (map[common.Address]types.OrderTransactions, map[common.Address]types.OrderTransactions) {
return b.eth.OrderPool().Content()
}
func (b *EthAPIBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subscription {
return b.eth.TxPool().SubscribeNewTxsEvent(ch)
}
@ -622,23 +608,6 @@ func (b *EthAPIBackend) AreTwoBlockSamePath(bh1 common.Hash, bh2 common.Hash) bo
return b.eth.blockchain.AreTwoBlockSamePath(bh1, bh2)
}
// GetOrderNonce get order nonce
func (b *EthAPIBackend) GetOrderNonce(address common.Hash) (uint64, error) {
XDCxService := b.eth.GetXDCX()
if XDCxService != nil {
author, err := b.Engine().Author(b.CurrentBlock().Header())
if err != nil {
return 0, err
}
XDCxState, err := XDCxService.GetTradingState(b.CurrentBlock(), author)
if err != nil {
return 0, err
}
return XDCxState.GetNonce(address), nil
}
return 0, errors.New("cannot find XDCx service")
}
func (b *EthAPIBackend) XDCxService() *XDCx.XDCX {
return b.eth.XDCX
}

View file

@ -2102,22 +2102,6 @@ func SubmitTransaction(ctx context.Context, b Backend, tx *types.Transaction) (c
return tx.Hash(), nil
}
// SubmitTransaction is a helper function that submits tx to txPool and logs a message.
func submitOrderTransaction(ctx context.Context, b Backend, tx *types.OrderTransaction) (common.Hash, error) {
if err := b.SendOrderTx(ctx, tx); err != nil {
return common.Hash{}, err
}
return tx.Hash(), nil
}
// submitLendingTransaction is a helper function that submits tx to txPool and logs a message.
func submitLendingTransaction(ctx context.Context, b Backend, tx *types.LendingTransaction) (common.Hash, error) {
if err := b.SendLendingTx(ctx, tx); err != nil {
return common.Hash{}, err
}
return tx.Hash(), nil
}
// SendTransaction creates a transaction for the given argument, sign it and submit it to the
// transaction pool.
func (s *TransactionAPI) SendTransaction(ctx context.Context, args TransactionArgs) (common.Hash, error) {

View file

@ -90,11 +90,6 @@ type Backend interface {
TxPoolContentFrom(addr common.Address) (types.Transactions, types.Transactions)
SubscribeNewTxsEvent(chan<- core.NewTxsEvent) event.Subscription
// Order Pool Transaction
SendOrderTx(ctx context.Context, signedTx *types.OrderTransaction) error
OrderTxPoolContent() (map[common.Address]types.OrderTransactions, map[common.Address]types.OrderTransactions)
SendLendingTx(ctx context.Context, signedTx *types.LendingTransaction) error
ChainConfig() *params.ChainConfig
Engine() consensus.Engine
CurrentBlock() *types.Block
@ -107,7 +102,6 @@ type Backend interface {
GetMasternodesCap(checkpoint uint64) map[common.Address]*big.Int
GetBlocksHashCache(blockNr uint64) []common.Hash
AreTwoBlockSamePath(newBlock common.Hash, oldBlock common.Hash) bool
GetOrderNonce(address common.Hash) (uint64, error)
// This is copied from filters.Backend
// eth/filters needs to be initialized from this backend type, so methods needed by

View file

@ -424,10 +424,6 @@ func (b *backendMock) GetMasternodesCap(uint64) map[common.Address]*big.Int {
return nil
}
func (b *backendMock) GetOrderNonce(common.Hash) (uint64, error) {
return 0, nil
}
func (b *backendMock) GetBody(ctx context.Context, hash common.Hash, number rpc.BlockNumber) (*types.Body, error) {
return nil, nil
}
@ -448,22 +444,10 @@ func (b *backendMock) LendingService() *XDCxlending.Lending {
return nil
}
func (b *backendMock) OrderTxPoolContent() (map[common.Address]types.OrderTransactions, map[common.Address]types.OrderTransactions) {
return nil, nil
}
func (b *backendMock) ProtocolVersion() int {
return 0
}
func (b *backendMock) SendLendingTx(context.Context, *types.LendingTransaction) error {
return nil
}
func (b *backendMock) SendOrderTx(context.Context, *types.OrderTransaction) error {
return nil
}
func (b *backendMock) XDCxService() *XDCx.XDCX {
return nil
}