From f709ef2edb23b7a4d052f01cb151536640a6b28d Mon Sep 17 00:00:00 2001 From: wit liu <765765346@qq.com> Date: Wed, 8 Oct 2025 12:25:10 +0800 Subject: [PATCH] all: remove extra empty lines (#1574) --- XDCx/tradingstate/orderitem.go | 3 --- XDCxlending/order_processor.go | 1 - contracts/XDCx/simulation/fee/lending/main.go | 1 - core/txpool/lending_pool.go | 1 - core/txpool/order_pool.go | 1 - eth/hooks/engine_v1_hooks.go | 1 - internal/ethapi/api.go | 4 ---- p2p/dial.go | 1 - p2p/simulations/http_test.go | 1 - p2p/simulations/network.go | 1 - 10 files changed, 15 deletions(-) diff --git a/XDCx/tradingstate/orderitem.go b/XDCx/tradingstate/orderitem.go index 8f7633d9a6..bf6608bd0c 100644 --- a/XDCx/tradingstate/orderitem.go +++ b/XDCx/tradingstate/orderitem.go @@ -205,7 +205,6 @@ func (o *OrderItem) VerifyOrder(state *state.StateDB) error { // VerifyBasicOrderInfo verify basic info func (o *OrderItem) VerifyBasicOrderInfo() error { - if o.Status == OrderNew { if o.Type == Limit { if err := o.verifyPrice(); err != nil { @@ -271,7 +270,6 @@ func (o *OrderItem) verifyOrderType() error { // verify order side func (o *OrderItem) verifyOrderSide() error { - if o.Side != Bid && o.Side != Ask { log.Debug("Invalid orderSide", "side", o.Side) return ErrInvalidOrderSide @@ -392,7 +390,6 @@ func (s *Signature) MarshalSignature() ([]byte, error) { // Verify returns the address that corresponds to the given signature and signed message func (s *Signature) Verify(hash common.Hash) (common.Address, error) { - hashBytes := hash.Bytes() sigBytes, err := s.MarshalSignature() if err != nil { diff --git a/XDCxlending/order_processor.go b/XDCxlending/order_processor.go index 389df5ca12..ad1ac4614f 100644 --- a/XDCxlending/order_processor.go +++ b/XDCxlending/order_processor.go @@ -1054,7 +1054,6 @@ func (l *Lending) GetCollateralPrices(header *types.Header, chain consensus.Chai } func (l *Lending) GetXDCBasePrices(header *types.Header, chain consensus.ChainContext, statedb *state.StateDB, tradingStateDb *tradingstate.TradingStateDB, token common.Address) (*big.Int, error) { - tokenXDCPriceFromContract, updatedBlock := lendingstate.GetCollateralPrice(statedb, token, common.XDCNativeAddressBinary) tokenXDCPriceUpdatedFromContract := updatedBlock.Uint64()/chain.Config().XDPoS.Epoch == header.Number.Uint64()/chain.Config().XDPoS.Epoch diff --git a/contracts/XDCx/simulation/fee/lending/main.go b/contracts/XDCx/simulation/fee/lending/main.go index 4e70c107df..92855060eb 100644 --- a/contracts/XDCx/simulation/fee/lending/main.go +++ b/contracts/XDCx/simulation/fee/lending/main.go @@ -48,5 +48,4 @@ func main() { fmt.Println("UpdateFee: Get receipt failed", err) } fmt.Println("UpdateFee: Done receipt status", r.Status) - } diff --git a/core/txpool/lending_pool.go b/core/txpool/lending_pool.go index 5837a8ced4..3dbdf816e2 100644 --- a/core/txpool/lending_pool.go +++ b/core/txpool/lending_pool.go @@ -621,7 +621,6 @@ func (pool *LendingPool) validateLending(tx *types.LendingTransaction) error { // validateTx checks whether a transaction is valid according to the consensus // rules and adheres to some heuristic limits of the local node (price and size). func (pool *LendingPool) validateTx(tx *types.LendingTransaction, local bool) error { - // check if sender is in black list if common.IsInBlacklist(tx.From()) { return fmt.Errorf("reject transaction with sender in black-list: %v", tx.From().Hex()) diff --git a/core/txpool/order_pool.go b/core/txpool/order_pool.go index b548f5087b..23bc6f6ac0 100644 --- a/core/txpool/order_pool.go +++ b/core/txpool/order_pool.go @@ -530,7 +530,6 @@ func (pool *OrderPool) validateOrder(tx *types.OrderTransaction) error { // validateTx checks whether a transaction is valid according to the consensus // rules and adheres to some heuristic limits of the local node (price and size). func (pool *OrderPool) validateTx(tx *types.OrderTransaction, local bool) error { - // check if sender is in black list if common.IsInBlacklist(tx.From()) { return fmt.Errorf("reject transaction with sender in black-list: %v", tx.From().Hex()) diff --git a/eth/hooks/engine_v1_hooks.go b/eth/hooks/engine_v1_hooks.go index 4d8e6a3dcd..6bcf2b4835 100644 --- a/eth/hooks/engine_v1_hooks.go +++ b/eth/hooks/engine_v1_hooks.go @@ -66,7 +66,6 @@ func AttachConsensusV1Hooks(adaptor *XDPoS.XDPoS, bc *core.BlockChain, chainConf } log.Debug("Time Calculated HookPenalty ", "block", blockNumberEpoc, "time", common.PrettyDuration(time.Since(start))) return penSigners, nil - } // Hook scans for bad masternodes and decide to penalty them diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 50d3ad558c..0e63fd4d08 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -2088,7 +2088,6 @@ func submitOrderTransaction(ctx context.Context, b Backend, tx *types.OrderTrans // 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 } @@ -2098,7 +2097,6 @@ func submitLendingTransaction(ctx context.Context, b Backend, tx *types.LendingT // 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) { - // Look up the wallet containing the requested signer account := accounts.Account{Address: args.from()} @@ -2201,7 +2199,6 @@ func (s *PublicXDCXTransactionPoolAPI) GetOrderTxMatchByHash(ctx context.Context orders = append(orders, order) } return orders, nil - } // GetOrderPoolContent return pending, queued content @@ -2354,7 +2351,6 @@ func (s *PublicXDCXTransactionPoolAPI) SendLending(ctx context.Context, msg Lend // GetOrderCount returns the number of transactions the given address has sent for the given block number func (s *PublicXDCXTransactionPoolAPI) GetOrderCount(ctx context.Context, addr common.Address) (*hexutil.Uint64, error) { - nonce, err := s.b.GetOrderNonce(addr.Hash()) if err != nil { return (*hexutil.Uint64)(&nonce), err diff --git a/p2p/dial.go b/p2p/dial.go index 320874d2d7..7d101498d0 100644 --- a/p2p/dial.go +++ b/p2p/dial.go @@ -413,7 +413,6 @@ func (h dialHistory) min() pastDial { } func (h *dialHistory) add(id discover.NodeID, exp time.Time) { heap.Push(h, pastDial{id, exp}) - } func (h *dialHistory) remove(id discover.NodeID) bool { for i, v := range *h { diff --git a/p2p/simulations/http_test.go b/p2p/simulations/http_test.go index 8af13d2db3..48f0d3adc2 100644 --- a/p2p/simulations/http_test.go +++ b/p2p/simulations/http_test.go @@ -478,7 +478,6 @@ func (t *expectEvents) expect(events ...*Event) { } switch expected.Type { - case EventTypeNode: if event.Node == nil { t.Fatal("expected event.Node to be set") diff --git a/p2p/simulations/network.go b/p2p/simulations/network.go index cbfb5e9ecb..d97c2014b1 100644 --- a/p2p/simulations/network.go +++ b/p2p/simulations/network.go @@ -688,7 +688,6 @@ func (net *Network) Load(snap *Snapshot) error { } } for _, conn := range snap.Conns { - if !net.GetNode(conn.One).Up || !net.GetNode(conn.Other).Up { //in this case, at least one of the nodes of a connection is not up, //so it would result in the snapshot `Load` to fail