mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 13:21:37 +00:00
all: fix unnecessary whitespace (#1800)
This commit is contained in:
parent
28efc50013
commit
d6309612fc
32 changed files with 0 additions and 40 deletions
|
|
@ -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...)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -653,7 +653,6 @@ func (rewardObj *AccountEpochReward) getRewardAndStatus(account string, data map
|
|||
}
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if signersData, exists := data["signersObserver"]; exists {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -46,5 +46,4 @@ func TestPriceFeed(t *testing.T) {
|
|||
t.Fatal("can't run function Foo() in smart contract: ", err)
|
||||
}
|
||||
fmt.Println("tx", tx)
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1547,7 +1547,6 @@ func TestBlocksHashCacheUpdate(t *testing.T) {
|
|||
t.Error("BlocksHashCache doesn't work when inserting block solely")
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
func TestAreTwoBlocksSamePath(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -194,10 +194,8 @@ func (tx *LendingTransaction) From() *common.Address {
|
|||
} else {
|
||||
return &f
|
||||
}
|
||||
|
||||
}
|
||||
return nil
|
||||
|
||||
}
|
||||
|
||||
// WithSignature returns a new transaction with the given signature.
|
||||
|
|
|
|||
|
|
@ -188,7 +188,6 @@ func (ordersign OrderTxSigner) Sender(tx *OrderTransaction) (common.Address, err
|
|||
}
|
||||
address := crypto.PubkeyToAddress(*pubKey)
|
||||
return address, nil
|
||||
|
||||
}
|
||||
|
||||
// CacheOrderSigner cache signed order
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -111,7 +111,6 @@ func TestEIP155SigningVitalik(t *testing.T) {
|
|||
if from != addr {
|
||||
t.Errorf("%d: expected %x got %x", i, addr, from)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -717,5 +717,4 @@ func (c *blake2F) Run(input []byte) ([]byte, error) {
|
|||
binary.LittleEndian.PutUint64(output[offset:offset+8], h[i])
|
||||
}
|
||||
return output, nil
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -224,7 +224,6 @@ func newSpuriousDragonInstructionSet() JumpTable {
|
|||
instructionSet := newTangerineWhistleInstructionSet()
|
||||
instructionSet[EXP].dynamicGas = gasExpEIP158
|
||||
return validate(instructionSet)
|
||||
|
||||
}
|
||||
|
||||
// EIP 150 a.k.a Tangerine Whistle
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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++
|
||||
|
|
|
|||
|
|
@ -155,7 +155,6 @@ func probabilistic(net *Network, quit chan struct{}, nodeCount int) {
|
|||
}
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// connect nodeCount number of nodes in a ring
|
||||
|
|
|
|||
|
|
@ -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():
|
||||
|
|
|
|||
|
|
@ -65,5 +65,4 @@ func (test *DifficultyTest) Run(config *params.ChainConfig) error {
|
|||
test.CurrentTimestamp, test.CurrentBlockNumber, actual, exp)
|
||||
}
|
||||
return nil
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue