diff --git a/bmt/bmt.go b/bmt/bmt.go index d8036a01ca..92c691e870 100644 --- a/bmt/bmt.go +++ b/bmt/bmt.go @@ -469,7 +469,6 @@ func (ha *Hasher) run(n *Node, h hash.Hash, d int, i int, s []byte) { h.Write(n.left) h.Write(n.right) s = h.Sum(nil) - } else { s = append(n.left, n.right...) } diff --git a/consensus/XDPoS/api.go b/consensus/XDPoS/api.go index 8215d78a6c..3029505360 100644 --- a/consensus/XDPoS/api.go +++ b/consensus/XDPoS/api.go @@ -653,7 +653,6 @@ func (rewardObj *AccountEpochReward) getRewardAndStatus(account string, data map } return } - } if signersData, exists := data["signersObserver"]; exists { diff --git a/consensus/XDPoS/engines/engine_v2/verifyHeader.go b/consensus/XDPoS/engines/engine_v2/verifyHeader.go index 12799c56e9..0f3c7ef414 100644 --- a/consensus/XDPoS/engines/engine_v2/verifyHeader.go +++ b/consensus/XDPoS/engines/engine_v2/verifyHeader.go @@ -161,7 +161,6 @@ func (x *XDPoS_v2) verifyHeader(chain consensus.ChainReader, header *types.Heade } return utils.ErrPenaltiesNotLegit } - } else { if len(header.Validators) != 0 { log.Warn("[verifyHeader] Validators shall not have values in non-epochSwitch block", "Hash", header.Hash(), "Number", header.Number, "header.Validators", header.Validators) diff --git a/consensus/tests/engine_v1_tests/helper.go b/consensus/tests/engine_v1_tests/helper.go index 04302b3a09..b50a359a11 100644 --- a/consensus/tests/engine_v1_tests/helper.go +++ b/consensus/tests/engine_v1_tests/helper.go @@ -192,7 +192,6 @@ func GetSnapshotSigner(bc *core.BlockChain, header *types.Header) (signersList, snap, err := engine.GetSnapshot(bc, header) if err != nil { return nil, err - } ms := make(signersList) diff --git a/consensus/tests/engine_v2_tests/authorised_masternode_test.go b/consensus/tests/engine_v2_tests/authorised_masternode_test.go index e67651515f..5ee7568dae 100644 --- a/consensus/tests/engine_v2_tests/authorised_masternode_test.go +++ b/consensus/tests/engine_v2_tests/authorised_masternode_test.go @@ -80,7 +80,6 @@ func TestIsYourTurnConsensusV2(t *testing.T) { isYourTurn, _ = adaptor.YourTurn(blockchain, currentBlock.Header(), common.HexToAddress("xdc5F74529C0338546f82389402a01c31fB52c6f434")) assert.False(t, isYourTurn) - } func TestIsYourTurnConsensusV2CrossConfig(t *testing.T) { diff --git a/consensus/tests/engine_v2_tests/helper.go b/consensus/tests/engine_v2_tests/helper.go index 74cbe9970d..d92807e177 100644 --- a/consensus/tests/engine_v2_tests/helper.go +++ b/consensus/tests/engine_v2_tests/helper.go @@ -385,7 +385,6 @@ func GetSnapshotSigner(bc *core.BlockChain, header *types.Header) (signersList, snap, err := engine.GetSnapshot(bc, header) if err != nil { return nil, err - } ms := make(signersList) @@ -393,7 +392,6 @@ func GetSnapshotSigner(bc *core.BlockChain, header *types.Header) (signersList, ms[addr.Hex()] = true } return ms, nil - } func GetCandidateFromCurrentSmartContract(backend bind.ContractBackend, t *testing.T) masterNodes { diff --git a/consensus/tests/engine_v2_tests/proposed_block_test.go b/consensus/tests/engine_v2_tests/proposed_block_test.go index ee8a07d24b..e709ab762a 100644 --- a/consensus/tests/engine_v2_tests/proposed_block_test.go +++ b/consensus/tests/engine_v2_tests/proposed_block_test.go @@ -174,7 +174,6 @@ func TestShouldNotCommitIfRoundsNotContinousFor3Rounds(t *testing.T) { assert.Equal(t, grandGrandParentBlock.Hash(), highestCommitBlock.Hash) assert.Equal(t, grandGrandParentBlock.Number(), highestCommitBlock.Number) assert.Equal(t, types.Round(3), highestCommitBlock.Round) - } func TestProposedBlockMessageHandlerSuccessfullyGenerateVote(t *testing.T) { diff --git a/consensus/tests/engine_v2_tests/reward_test.go b/consensus/tests/engine_v2_tests/reward_test.go index c2e7285136..fc9dbd24c4 100644 --- a/consensus/tests/engine_v2_tests/reward_test.go +++ b/consensus/tests/engine_v2_tests/reward_test.go @@ -282,7 +282,6 @@ func TestHookRewardAfterUpgrade(t *testing.T) { } else { assert.Fail(t, "wrong reward") } - } resultObserver := reward["rewardsObserver"].(map[common.Address]interface{}) // observer1 and it signs one tx, observer2 is inside penalty so no reward diff --git a/consensus/tests/engine_v2_tests/verify_header_test.go b/consensus/tests/engine_v2_tests/verify_header_test.go index 68f9617a44..14e84bd1c8 100644 --- a/consensus/tests/engine_v2_tests/verify_header_test.go +++ b/consensus/tests/engine_v2_tests/verify_header_test.go @@ -395,7 +395,6 @@ func TestShouldFailIfNotEnoughQCSignatures(t *testing.T) { // Happy path err = adaptor.VerifyHeader(blockchain, headerWithDuplicatedSignatures, true) assert.Equal(t, utils.ErrInvalidQCSignatures, err) - } func TestShouldVerifyHeaders(t *testing.T) { diff --git a/consensus/tests/engine_v2_tests/vote_test.go b/consensus/tests/engine_v2_tests/vote_test.go index 777efc11d7..e45eda220a 100644 --- a/consensus/tests/engine_v2_tests/vote_test.go +++ b/consensus/tests/engine_v2_tests/vote_test.go @@ -225,7 +225,6 @@ func TestThrowErrorIfVoteMsgRoundIsMoreThanOneRoundAwayFromCurrentRound(t *testi err = engineV2.VoteHandler(blockchain, voteMsg) assert.NotNil(t, err) assert.Equal(t, "vote message round number: 6 is too far away from currentRound: 4", err.Error()) - } func TestProcessVoteMsgThenTimeoutMsg(t *testing.T) { diff --git a/contracts/tests/Inherited_test.go b/contracts/tests/Inherited_test.go index 2a0c128487..9c6764708b 100644 --- a/contracts/tests/Inherited_test.go +++ b/contracts/tests/Inherited_test.go @@ -46,5 +46,4 @@ func TestPriceFeed(t *testing.T) { t.Fatal("can't run function Foo() in smart contract: ", err) } fmt.Println("tx", tx) - } diff --git a/core/blockchain_test.go b/core/blockchain_test.go index 707633579a..46d09e4656 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -1547,7 +1547,6 @@ func TestBlocksHashCacheUpdate(t *testing.T) { t.Error("BlocksHashCache doesn't work when inserting block solely") } }) - } func TestAreTwoBlocksSamePath(t *testing.T) { diff --git a/core/txpool/lending_pool.go b/core/txpool/lending_pool.go index 3e46a095d6..9fdf39ec77 100644 --- a/core/txpool/lending_pool.go +++ b/core/txpool/lending_pool.go @@ -692,7 +692,6 @@ func (pool *LendingPool) add(tx *types.LendingTransaction, local bool) (bool, er log.Debug("Lending Pooled new executable transaction", "hash", hash, "useraddress", tx.UserAddress(), "nonce", tx.Nonce(), "status", tx.Status(), "lendingid", tx.LendingId()) return old != nil, nil - } // New transaction isn't replacing a pending one, push into queue replace, err := pool.enqueueTx(hash, tx) diff --git a/core/txpool/order_pool.go b/core/txpool/order_pool.go index 44ff861505..f9a624fa72 100644 --- a/core/txpool/order_pool.go +++ b/core/txpool/order_pool.go @@ -495,7 +495,6 @@ func (pool *OrderPool) validateOrder(tx *types.OrderTransaction) error { } else { tx.SetOrderHash(signer.Hash(tx)) } - } else { if tx.OrderID() == 0 { return ErrInvalidCancelledOrder @@ -601,7 +600,6 @@ func (pool *OrderPool) add(tx *types.OrderTransaction, local bool) (bool, error) log.Debug("Pooled new executable transaction", "hash", hash, "useraddress", tx.UserAddress().Hex(), "nonce", tx.Nonce(), "status", tx.Status(), "orderid", tx.OrderID()) go pool.txFeed.Send(core.OrderTxPreEvent{Tx: tx}) return old != nil, nil - } // New transaction isn't replacing a pending one, push into queue replace, err := pool.enqueueTx(hash, tx) @@ -876,7 +874,6 @@ func (pool *OrderPool) promoteExecutables(accounts []common.Address) { hash := tx.Hash() log.Debug("Removed old queued transaction", "addr", tx.UserAddress().Hex(), "nonce", tx.Nonce(), "ohash", tx.OrderHash().Hex(), "status", tx.Status(), "orderid", tx.OrderID()) delete(pool.all, hash) - } // Gather all executable transactions and promote them diff --git a/core/types/lending_transaction.go b/core/types/lending_transaction.go index 61e93906ba..03cd1a9420 100644 --- a/core/types/lending_transaction.go +++ b/core/types/lending_transaction.go @@ -194,10 +194,8 @@ func (tx *LendingTransaction) From() *common.Address { } else { return &f } - } return nil - } // WithSignature returns a new transaction with the given signature. diff --git a/core/types/order_signing.go b/core/types/order_signing.go index c03f4dc141..23568e33d9 100644 --- a/core/types/order_signing.go +++ b/core/types/order_signing.go @@ -188,7 +188,6 @@ func (ordersign OrderTxSigner) Sender(tx *OrderTransaction) (common.Address, err } address := crypto.PubkeyToAddress(*pubKey) return address, nil - } // CacheOrderSigner cache signed order diff --git a/core/types/transaction.go b/core/types/transaction.go index eb9fcbaf86..d774375fc7 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -514,7 +514,6 @@ func (tx *Transaction) IsVotingTransaction() (bool, *common.Address) { addr := data[end-20 : end] m := common.BytesToAddress(addr) return true, &m - } func (tx *Transaction) IsXDCXApplyTransaction() bool { diff --git a/core/types/transaction_signing_test.go b/core/types/transaction_signing_test.go index 90c6e90682..3c83b1b406 100644 --- a/core/types/transaction_signing_test.go +++ b/core/types/transaction_signing_test.go @@ -111,7 +111,6 @@ func TestEIP155SigningVitalik(t *testing.T) { if from != addr { t.Errorf("%d: expected %x got %x", i, addr, from) } - } } diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 14c47186bb..c4c7295ff9 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -717,5 +717,4 @@ func (c *blake2F) Run(input []byte) ([]byte, error) { binary.LittleEndian.PutUint64(output[offset:offset+8], h[i]) } return output, nil - } diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index e8f0e43eeb..828b862447 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -224,7 +224,6 @@ func newSpuriousDragonInstructionSet() JumpTable { instructionSet := newTangerineWhistleInstructionSet() instructionSet[EXP].dynamicGas = gasExpEIP158 return validate(instructionSet) - } // EIP 150 a.k.a Tangerine Whistle diff --git a/eth/backend.go b/eth/backend.go index 374eccafb8..a6a22edd3a 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -358,7 +358,6 @@ func New(stack *node.Node, config *ethconfig.Config, XDCXServ *XDCx.XDCX, lendin eth.txPool.IsSigner = func(address common.Address) bool { return c.IsAuthorisedAddress(eth.blockchain, eth.blockchain.CurrentHeader(), address) } - } // Start the RPC service eth.netRPCService = ethapi.NewNetAPI(eth.p2pServer, eth.NetVersion()) diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go index a4e3d1449d..9cee05d056 100644 --- a/eth/downloader/downloader_test.go +++ b/eth/downloader/downloader_test.go @@ -537,7 +537,6 @@ func testThrottling(t *testing.T, protocol int, mode SyncMode) { tester.downloader.queue.resultCache.lock.Unlock() frozen = int(atomic.LoadUint32(&blocked)) retrieved = len(tester.ownBlocks) - } tester.lock.Unlock() @@ -569,7 +568,6 @@ func testThrottling(t *testing.T, protocol int, mode SyncMode) { t.Fatalf("block synchronization failed: %v", err) } tester.terminate() - } // Tests that simple synchronization against a forked chain works correctly. In diff --git a/eth/downloader/peer_test.go b/eth/downloader/peer_test.go index 4bf0e200bb..a186816229 100644 --- a/eth/downloader/peer_test.go +++ b/eth/downloader/peer_test.go @@ -49,5 +49,4 @@ func TestPeerThroughputSorting(t *testing.T) { if got, exp := sortPeers.p[2].id, "b"; got != exp { t.Errorf("sort fail, got %v exp %v", got, exp) } - } diff --git a/eth/downloader/queue_test.go b/eth/downloader/queue_test.go index 738a413ef6..f20e4af39d 100644 --- a/eth/downloader/queue_test.go +++ b/eth/downloader/queue_test.go @@ -168,7 +168,6 @@ func TestBasics(t *testing.T) { if got, exp := fetchReq.Headers[0].Number.Uint64(), uint64(1); got != exp { t.Fatalf("expected header %d, got %d", exp, got) } - } //fmt.Printf("blockTaskQueue len: %d\n", q.blockTaskQueue.Size()) //fmt.Printf("receiptTaskQueue len: %d\n", q.receiptTaskQueue.Size()) @@ -208,7 +207,6 @@ func TestEmptyBlocks(t *testing.T) { if fetchReq != nil { t.Fatal("there should be no body fetch tasks remaining") } - } if q.blockTaskQueue.Size() != len(emptyChain.blocks)-10 { t.Errorf("expected block task queue to be 0, got %d", q.blockTaskQueue.Size()) @@ -270,7 +268,6 @@ func XTestDelivery(t *testing.T) { fmt.Printf("got %d results, %d tot\n", len(res), tot) // Now we can forget about these world.forget(res[len(res)-1].Header.Number.Uint64()) - } }) wg.Go(func() { @@ -328,7 +325,6 @@ func XTestDelivery(t *testing.T) { } for i := 0; i < 50; i++ { time.Sleep(2990 * time.Millisecond) - } }) wg.Go(func() { diff --git a/eth/handler.go b/eth/handler.go index cf3ac5744c..b00e2eb5c7 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -996,7 +996,6 @@ func (pm *ProtocolManager) BroadcastSyncInfo(syncInfo *types.SyncInfo) { } log.Trace("Propagated SyncInfo", "hash", hash, "recipients", len(peers)) } - } // OrderBroadcastTx will propagate a transaction to all peers which are not known to diff --git a/miner/worker.go b/miner/worker.go index 3822d161a8..6e126cd014 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -1152,7 +1152,6 @@ func (w *Work) commitTransactions(mux *event.TypeMux, balanceFee map[common.Addr log.Warn("[commitTransactions] Error when sending PendingStateEvent", "tcount", tcount) } }(w.tcount) - } } diff --git a/node/node_test.go b/node/node_test.go index 5608604799..9732d5d24c 100644 --- a/node/node_test.go +++ b/node/node_test.go @@ -514,7 +514,6 @@ func (test rpcPrefixTest) check(t *testing.T, node *Node) { if err == nil { t.Errorf("Error: %s: WebSocket connection succeeded for path in wantNoWS", path) } - } } diff --git a/node/rpcstack.go b/node/rpcstack.go index f35dfe13b7..28b874ef33 100644 --- a/node/rpcstack.go +++ b/node/rpcstack.go @@ -457,7 +457,6 @@ func (h *virtualHostHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { // It's an IP address, we can serve that h.next.ServeHTTP(w, r) return - } // Not an IP address, but a hostname. Need to validate if _, exist := h.vhosts["*"]; exist { diff --git a/p2p/simulations/http_test.go b/p2p/simulations/http_test.go index 48f0d3adc2..ecd70dd5ef 100644 --- a/p2p/simulations/http_test.go +++ b/p2p/simulations/http_test.go @@ -502,7 +502,6 @@ func (t *expectEvents) expect(events ...*Event) { if event.Conn.Up != expected.Conn.Up { t.Fatalf("expected conn event %d to have up=%t, got up=%t", i, expected.Conn.Up, event.Conn.Up) } - } i++ diff --git a/p2p/simulations/mocker.go b/p2p/simulations/mocker.go index d2737e33bb..5d5548273b 100644 --- a/p2p/simulations/mocker.go +++ b/p2p/simulations/mocker.go @@ -155,7 +155,6 @@ func probabilistic(net *Network, quit chan struct{}, nodeCount int) { } wg.Wait() } - } // connect nodeCount number of nodes in a ring diff --git a/p2p/simulations/network.go b/p2p/simulations/network.go index d97c2014b1..916fd1193d 100644 --- a/p2p/simulations/network.go +++ b/p2p/simulations/network.go @@ -245,7 +245,6 @@ func (net *Network) watchPeerEvents(id discover.NodeID, events chan *p2p.PeerEve case p2p.PeerEventTypeMsgRecv: net.DidReceive(peer, id, event.Protocol, *event.MsgCode) - } case err := <-sub.Err(): diff --git a/tests/difficulty_test_util.go b/tests/difficulty_test_util.go index 4af91a2206..2d46b4b611 100644 --- a/tests/difficulty_test_util.go +++ b/tests/difficulty_test_util.go @@ -65,5 +65,4 @@ func (test *DifficultyTest) Run(config *params.ChainConfig) error { test.CurrentTimestamp, test.CurrentBlockNumber, actual, exp) } return nil - }