Skip to content

Commit 79e1b04

Browse files
committed
style: fix other lint
1 parent f8f36e9 commit 79e1b04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+151
-171
lines changed

consensus/dummy/consensus.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ func (eng *DummyEngine) verifyBlockFee(
329329
return nil
330330
}
331331

332-
func (eng *DummyEngine) Finalize(chain consensus.ChainHeaderReader, block *types.Block, parent *types.Header, state *state.StateDB, receipts []*types.Receipt) error {
332+
func (eng *DummyEngine) Finalize(chain consensus.ChainHeaderReader, block *types.Block, parent *types.Header, _ *state.StateDB, receipts []*types.Receipt) error {
333333
config := params.GetExtra(chain.Config())
334334
timestamp := block.Time()
335335
// we use the parent to determine the fee config

core/blockchain_ext_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ func StatefulPrecompiles(t *testing.T, create createFunc) {
16921692

16931693
// Generate chain of blocks using [genDB] instead of [chainDB] to avoid writing
16941694
// to the BlockChain's database while generating blocks.
1695-
_, chain, _, err := GenerateChainWithGenesis(gspec, blockchain.engine, 1, 0, func(i int, gen *BlockGen) {
1695+
_, chain, _, err := GenerateChainWithGenesis(gspec, blockchain.engine, 1, 0, func(_ int, gen *BlockGen) {
16961696
for _, test := range tests {
16971697
test.addTx(gen)
16981698
}

core/blockchain_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ type wrappedStateManager struct {
164164
TrieWriter
165165
}
166166

167-
func (w *wrappedStateManager) Shutdown() error { return nil }
167+
func (*wrappedStateManager) Shutdown() error { return nil }
168168

169169
func TestPruningBlockChainUngracefulShutdown(t *testing.T) {
170170
create := func(db ethdb.Database, gspec *Genesis, lastAcceptedHash common.Hash, _ string) (*BlockChain, error) {
@@ -360,7 +360,7 @@ func testRepopulateMissingTriesParallel(t *testing.T, parallelism int) {
360360

361361
// This call generates a chain of 3 blocks.
362362
signer := types.HomesteadSigner{}
363-
_, chain, _, err := GenerateChainWithGenesis(gspec, blockchain.engine, 10, 10, func(i int, gen *BlockGen) {
363+
_, chain, _, err := GenerateChainWithGenesis(gspec, blockchain.engine, 10, 10, func(_ int, gen *BlockGen) {
364364
tx, _ := types.SignTx(types.NewTransaction(gen.TxNonce(addr1), addr2, big.NewInt(10000), ethparams.TxGas, nil, nil), signer, key1)
365365
gen.AddTx(tx)
366366
})
@@ -534,11 +534,11 @@ func testCanonicalHashMarker(t *testing.T, scheme string) {
534534
}
535535
engine = dummy.NewCoinbaseFaker()
536536
)
537-
_, forkA, _, err := GenerateChainWithGenesis(gspec, engine, c.forkA, 10, func(i int, gen *BlockGen) {})
537+
_, forkA, _, err := GenerateChainWithGenesis(gspec, engine, c.forkA, 10, func(_ int, _ *BlockGen) {})
538538
if err != nil {
539539
t.Fatal(err)
540540
}
541-
_, forkB, _, err := GenerateChainWithGenesis(gspec, engine, c.forkB, 10, func(i int, gen *BlockGen) {})
541+
_, forkB, _, err := GenerateChainWithGenesis(gspec, engine, c.forkB, 10, func(_ int, _ *BlockGen) {})
542542
if err != nil {
543543
t.Fatal(err)
544544
}
@@ -708,7 +708,7 @@ func testCreateThenDelete(t *testing.T, config *params.ChainConfig) {
708708
}
709709
nonce := uint64(0)
710710
signer := types.HomesteadSigner{}
711-
_, blocks, _, _ := GenerateChainWithGenesis(gspec, engine, 2, 10, func(i int, b *BlockGen) {
711+
_, blocks, _, _ := GenerateChainWithGenesis(gspec, engine, 2, 10, func(_ int, b *BlockGen) {
712712
fee := big.NewInt(1)
713713
if b.header.BaseFee != nil {
714714
fee = b.header.BaseFee
@@ -911,7 +911,7 @@ func TestTransientStorageReset(t *testing.T) {
911911
}
912912
nonce := uint64(0)
913913
signer := types.HomesteadSigner{}
914-
_, blocks, _, _ := GenerateChainWithGenesis(gspec, engine, 1, 10, func(i int, b *BlockGen) {
914+
_, blocks, _, _ := GenerateChainWithGenesis(gspec, engine, 1, 10, func(_ int, b *BlockGen) {
915915
fee := big.NewInt(1)
916916
if b.header.BaseFee != nil {
917917
fee = b.header.BaseFee
@@ -1009,7 +1009,7 @@ func TestEIP3651(t *testing.T) {
10091009

10101010
signer := types.LatestSigner(gspec.Config)
10111011

1012-
_, blocks, _, _ := GenerateChainWithGenesis(gspec, engine, 1, 10, func(i int, b *BlockGen) {
1012+
_, blocks, _, _ := GenerateChainWithGenesis(gspec, engine, 1, 10, func(_ int, b *BlockGen) {
10131013
b.SetCoinbase(aa)
10141014
// One transaction to Coinbase
10151015
txdata := &types.DynamicFeeTx{

core/state/trie_prefetcher_extra_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func BenchmarkPrefetcherDatabase(b *testing.B) {
130130
}
131131
}
132132
require.NoError(levelDB.Close())
133-
b.Logf("Starting benchmarks")
133+
b.Log("Starting benchmarks")
134134
b.Logf("Root: %v, kvs: %d, block: %d", root, count, block)
135135
for _, updates := range []int{100, 200, 500} {
136136
for _, prefetchers := range []int{0, 1, 4, 16} {

ethclient/client_interface_test.go

Lines changed: 0 additions & 20 deletions
This file was deleted.

internal/ethapi/api_extra.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func (s *BlockChainAPI) FeeConfig(ctx context.Context, blockNrOrHash *rpc.BlockN
122122

123123
// GetActivePrecompilesAt returns the active precompile configs at the given block timestamp.
124124
// DEPRECATED: Use GetActiveRulesAt instead.
125-
func (s *BlockChainAPI) GetActivePrecompilesAt(ctx context.Context, blockTimestamp *uint64) extras.Precompiles {
125+
func (s *BlockChainAPI) GetActivePrecompilesAt(_ context.Context, blockTimestamp *uint64) extras.Precompiles {
126126
var timestamp uint64
127127
if blockTimestamp == nil {
128128
timestamp = s.b.CurrentHeader().Time
@@ -144,7 +144,7 @@ type ActiveRulesResult struct {
144144
}
145145

146146
// GetActiveRulesAt returns the active rules at the given block timestamp.
147-
func (s *BlockChainAPI) GetActiveRulesAt(ctx context.Context, blockTimestamp *uint64) ActiveRulesResult {
147+
func (s *BlockChainAPI) GetActiveRulesAt(_ context.Context, blockTimestamp *uint64) ActiveRulesResult {
148148
var timestamp uint64
149149
if blockTimestamp == nil {
150150
timestamp = s.b.CurrentHeader().Time

network/network_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,11 +682,11 @@ type HelloGreetingRequestHandler struct {
682682
codec codec.Manager
683683
}
684684

685-
func (h *HelloGreetingRequestHandler) HandleHelloRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, request *HelloRequest) ([]byte, error) {
685+
func (h *HelloGreetingRequestHandler) HandleHelloRequest(_ context.Context, _ ids.NodeID, _ uint32, _ *HelloRequest) ([]byte, error) {
686686
return h.codec.Marshal(message.Version, HelloResponse{Response: "Hi"})
687687
}
688688

689-
func (h *HelloGreetingRequestHandler) HandleGreetingRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, request *GreetingRequest) ([]byte, error) {
689+
func (h *HelloGreetingRequestHandler) HandleGreetingRequest(_ context.Context, _ ids.NodeID, _ uint32, _ *GreetingRequest) ([]byte, error) {
690690
return h.codec.Marshal(message.Version, GreetingResponse{Greet: "Hey there"})
691691
}
692692

params/extras/state_upgrade.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (c *ChainConfig) verifyStateUpgrades() error {
6060

6161
// GetActivatingStateUpgrades returns all state upgrades configured to activate during the
6262
// state transition from a block with timestamp [from] to a block with timestamp [to].
63-
func (c *ChainConfig) GetActivatingStateUpgrades(from *uint64, to uint64, upgrades []StateUpgrade) []StateUpgrade {
63+
func (*ChainConfig) GetActivatingStateUpgrades(from *uint64, to uint64, upgrades []StateUpgrade) []StateUpgrade {
6464
activating := make([]StateUpgrade, 0)
6565
for _, upgrade := range upgrades {
6666
if IsForkTransition(upgrade.BlockTimestamp, from, to) {

params/hooks_libevm.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (RulesExtra) CanExecuteTransaction(_ common.Address, _ *common.Address, _ l
5656
return nil
5757
}
5858

59-
func (r RulesExtra) ActivePrecompiles(existing []common.Address) []common.Address {
59+
func (RulesExtra) ActivePrecompiles(existing []common.Address) []common.Address {
6060
return existing
6161
}
6262

@@ -68,7 +68,7 @@ func (RulesExtra) MinimumGasConsumption(x uint64) uint64 {
6868
// precompileOverrideBuiltin specifies precompiles that were activated prior to the
6969
// dynamic precompile activation registry.
7070
// These were only active historically and are not active in the current network.
71-
func (r RulesExtra) precompileOverrideBuiltin(addr common.Address) (libevm.PrecompiledContract, bool) {
71+
func (RulesExtra) precompileOverrideBuiltin(_ common.Address) (libevm.PrecompiledContract, bool) {
7272
return nil, false
7373
}
7474

plugin/evm/admin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (p *Admin) StartCPUProfiler(_ *http.Request, _ *struct{}, _ *api.EmptyReply
3838
}
3939

4040
// StopCPUProfiler stops the cpu profile
41-
func (p *Admin) StopCPUProfiler(r *http.Request, _ *struct{}, _ *api.EmptyReply) error {
41+
func (p *Admin) StopCPUProfiler(_ *http.Request, _ *struct{}, _ *api.EmptyReply) error {
4242
log.Info("Admin: StopCPUProfiler called")
4343

4444
p.vm.vmLock.Lock()
@@ -67,7 +67,7 @@ func (p *Admin) LockProfile(_ *http.Request, _ *struct{}, _ *api.EmptyReply) err
6767
return p.profiler.LockProfile()
6868
}
6969

70-
func (p *Admin) SetLogLevel(_ *http.Request, args *client.SetLogLevelArgs, reply *api.EmptyReply) error {
70+
func (p *Admin) SetLogLevel(_ *http.Request, args *client.SetLogLevelArgs, _ *api.EmptyReply) error {
7171
log.Info("EVM: SetLogLevel called", "logLevel", args.Level)
7272

7373
p.vm.vmLock.Lock()

0 commit comments

Comments
 (0)