mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 13:21:37 +00:00
all: fix whitespace error of golangci-lint, remove extra empty lines (#1676)
This commit is contained in:
parent
1fa780768f
commit
39eb15531d
18 changed files with 4 additions and 22 deletions
|
|
@ -351,7 +351,6 @@ func Test_getCancelFee(t *testing.T) {
|
|||
if fee, _ := XDCx.getCancelFee(nil, nil, tradingStateDb, tokenDOrder.order, tokenDOrder.feeRate); fee != nil && fee.Sign() != 0 {
|
||||
t.Errorf("getCancelFee() = %v, want %v", fee, common.Big0)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestGetTradeQuantity(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -129,7 +129,6 @@ func (ms *XDCXManagedState) getAccount(addr common.Hash) *exchanges {
|
|||
if so != nil && uint64(len(account.nonces))+account.nstart < so.Nonce() {
|
||||
ms.exchanges[addr] = newAccount(so)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return ms.exchanges[addr]
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ func TestEchangeStates(t *testing.T) {
|
|||
mapPriceBuy[amount] = old + amount
|
||||
default:
|
||||
}
|
||||
|
||||
}
|
||||
statedb.SetLastPrice(orderBook, price)
|
||||
statedb.InsertLiquidationPrice(orderBook, big.NewInt(1), orderBook, 2)
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ func NewBatchDatabaseWithEncode(datadir string, cacheLimit int) *BatchDatabase {
|
|||
}
|
||||
|
||||
return batchDB
|
||||
|
||||
}
|
||||
|
||||
func (db *BatchDatabase) IsEmptyKey(key []byte) bool {
|
||||
|
|
|
|||
|
|
@ -140,7 +140,6 @@ func runCmd(ctx *cli.Context) error {
|
|||
}
|
||||
}
|
||||
code = common.Hex2Bytes(string(bytes.TrimRight(hexcode, "\n")))
|
||||
|
||||
} else if ctx.String(CodeFlag.Name) != "" {
|
||||
code = common.Hex2Bytes(ctx.String(CodeFlag.Name))
|
||||
} else if fn := ctx.Args().First(); len(fn) > 0 {
|
||||
|
|
|
|||
|
|
@ -211,7 +211,6 @@ func (x *XDPoS) VerifyHeader(chain consensus.ChainReader, header *types.Header,
|
|||
// method returns a quit channel to abort the operations and a results channel to
|
||||
// retrieve the async verifications (the order is that of the input slice).
|
||||
func (x *XDPoS) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, fullVerifies []bool) (chan<- struct{}, <-chan error) {
|
||||
|
||||
abort := make(chan struct{})
|
||||
results := make(chan error, len(headers))
|
||||
|
||||
|
|
|
|||
|
|
@ -144,7 +144,6 @@ func getCommonBackend(t *testing.T, chainConfig *params.ChainConfig) *backends.S
|
|||
}, 10000000, chainConfig)
|
||||
|
||||
return contractBackend2
|
||||
|
||||
}
|
||||
|
||||
func transferTx(t *testing.T, to common.Address, transferAmount int64) *types.Transaction {
|
||||
|
|
@ -201,7 +200,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 {
|
||||
|
|
|
|||
|
|
@ -274,7 +274,6 @@ func getMultiCandidatesBackend(t *testing.T, chainConfig *params.ChainConfig, n
|
|||
}
|
||||
|
||||
func getProtectorObserverBackend(t *testing.T, chainConfig *params.ChainConfig) *backends.SimulatedBackend {
|
||||
|
||||
// initial helper backend
|
||||
contractBackendForSC := backends.NewXDCSimulatedBackend(types.GenesisAlloc{
|
||||
voterAddr: {Balance: new(big.Int).SetUint64(10000000000)},
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ func airDropTokenToAccountNoXDC() {
|
|||
log.Fatal("can't execute transferAmount in tr21:", err)
|
||||
}
|
||||
}
|
||||
|
||||
func testTransferTRC21TokenWithAccountNoXDC() {
|
||||
client, err := ethclient.Dial(simulation.RpcEndpoint)
|
||||
if err != nil {
|
||||
|
|
@ -127,6 +128,7 @@ func testTransferTRC21TokenWithAccountNoXDC() {
|
|||
log.Fatal("can't get balance token fee in smart contract: ", err, "got", balanceIssuerFee, "wanted", remainFee)
|
||||
}
|
||||
}
|
||||
|
||||
func testTransferTrc21Fail() {
|
||||
client, err := ethclient.Dial(simulation.RpcEndpoint)
|
||||
if err != nil {
|
||||
|
|
@ -192,8 +194,8 @@ func testTransferTrc21Fail() {
|
|||
if err != nil || balance.Cmp(remainFee) != 0 {
|
||||
log.Fatal("can't get balance token fee in smart contract: ", err, "got", balanceIssuerFee, "wanted", remainFee)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func main() {
|
||||
fmt.Println("========================")
|
||||
fmt.Println("airdropAddr", simulation.AirdropAddr.Hex())
|
||||
|
|
|
|||
|
|
@ -178,7 +178,6 @@ func TestRewardBalance(t *testing.T) {
|
|||
|
||||
t.Errorf("reward total %v - %v", totalReward, afterReward)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func GetRewardBalancesRate(foudationWalletAddr common.Address, masterAddr common.Address, totalReward *big.Int, validator *contractValidator.XDCValidator) (map[common.Address]*big.Int, error) {
|
||||
|
|
|
|||
|
|
@ -964,7 +964,6 @@ func (pool *LendingPool) promoteExecutables(accounts []common.Address) {
|
|||
hash := tx.Hash()
|
||||
log.Trace("Removed old queued transaction", "hash", hash)
|
||||
delete(pool.all, hash)
|
||||
|
||||
}
|
||||
|
||||
// Gather all executable transactions and promote them
|
||||
|
|
|
|||
|
|
@ -110,5 +110,4 @@ func (l *LendingMsg) computeHash() common.Hash {
|
|||
}
|
||||
|
||||
return common.BytesToHash(sha.Sum(nil))
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -483,7 +483,6 @@ func (pool *OrderPool) validateOrder(tx *types.OrderTransaction) error {
|
|||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if orderStatus != OrderStatusNew && orderStatus != OrderStatusCancle {
|
||||
|
|
|
|||
|
|
@ -560,7 +560,6 @@ func (d *Downloader) Terminate() {
|
|||
// fetchHeight retrieves the head header of the remote peer to aid in estimating
|
||||
// the total time a pending synchronisation would take.
|
||||
func (d *Downloader) fetchHeight(p *peerConnection, hash common.Hash) (*types.Header, error) {
|
||||
|
||||
// Request the advertised remote head block and wait for the response
|
||||
go p.peer.RequestHeadersByHash(hash, 1, 0, false)
|
||||
|
||||
|
|
@ -1121,7 +1120,6 @@ func (d *Downloader) fetchParts(deliveryCh chan dataPack, deliver func(dataPack)
|
|||
expire func() map[string]int, pending func() int, inFlight func() bool, reserve func(*peerConnection, int) (*fetchRequest, bool, bool),
|
||||
fetchHook func([]*types.Header), fetch func(*peerConnection, *fetchRequest) error, cancel func(*fetchRequest), capacity func(*peerConnection) int,
|
||||
idle func() ([]*peerConnection, int), setIdle func(*peerConnection, int, time.Time), kind string) error {
|
||||
|
||||
// Create a ticker to detect expired retrieval tasks
|
||||
ticker := time.NewTicker(100 * time.Millisecond)
|
||||
defer ticker.Stop()
|
||||
|
|
|
|||
|
|
@ -831,7 +831,6 @@ func (q *queue) deliver(id string, taskPool map[common.Hash]*types.Header,
|
|||
taskQueue *prque.Prque[int64, *types.Header], pendPool map[string]*fetchRequest, reqTimer *metrics.Timer,
|
||||
results int, validate func(index int, header *types.Header) error,
|
||||
reconstruct func(index int, result *fetchResult)) (int, error) {
|
||||
|
||||
// Short circuit if the data was never requested
|
||||
request := pendPool[id]
|
||||
if request == nil {
|
||||
|
|
|
|||
|
|
@ -389,10 +389,9 @@ func (n *network) forget(blocknum uint64) {
|
|||
n.chain = n.chain[index:]
|
||||
n.receipts = n.receipts[index:]
|
||||
n.offset = int(blocknum)
|
||||
|
||||
}
|
||||
func (n *network) progress(numBlocks int) {
|
||||
|
||||
func (n *network) progress(numBlocks int) {
|
||||
n.lock.Lock()
|
||||
defer n.lock.Unlock()
|
||||
//fmt.Printf("progressing...\n")
|
||||
|
|
@ -400,7 +399,6 @@ func (n *network) progress(numBlocks int) {
|
|||
n.chain = append(n.chain, newBlocks...)
|
||||
n.receipts = append(n.receipts, newR...)
|
||||
n.cond.Broadcast()
|
||||
|
||||
}
|
||||
|
||||
func (n *network) headers(from int) []*types.Header {
|
||||
|
|
|
|||
|
|
@ -562,7 +562,6 @@ func (f *Fetcher) loop() {
|
|||
} else {
|
||||
f.forgetHash(hash)
|
||||
}
|
||||
|
||||
}
|
||||
if matched {
|
||||
task.transactions = append(task.transactions[:i], task.transactions[i+1:]...)
|
||||
|
|
|
|||
|
|
@ -63,5 +63,4 @@ func TestParseEthstatsURL(t *testing.T) {
|
|||
t.Errorf("case=%d mismatch host value, got: %v ,want: %v", i, host, c.host)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue