forked from cerc-io/plugeth
all: add whitespace linter (#25312)
* golangci: typo Signed-off-by: Delweng <delweng@gmail.com> * golangci: add whietspace Signed-off-by: Delweng <delweng@gmail.com> * *: rm whitesapce using golangci-lint Signed-off-by: Delweng <delweng@gmail.com> * cmd/puppeth: revert accidental resurrection Co-authored-by: Péter Szilágyi <peterke@gmail.com>
This commit is contained in:
co-authored by
Péter Szilágyi
parent
6c4e5d06e7
commit
b196ad1c16
@@ -1235,7 +1235,6 @@ func TestSideLogRebirth(t *testing.T) {
|
||||
chain, _ := GenerateChain(params.TestChainConfig, genesis, ethash.NewFaker(), db, 2, func(i int, gen *BlockGen) {
|
||||
if i == 1 {
|
||||
gen.OffsetTime(-9) // higher block difficulty
|
||||
|
||||
}
|
||||
})
|
||||
if _, err := blockchain.InsertChain(chain); err != nil {
|
||||
@@ -1364,7 +1363,6 @@ done:
|
||||
t.Errorf("unexpected event fired: %v", e)
|
||||
case <-time.After(250 * time.Millisecond):
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Tests if the canonical block can be fetched from the database during chain insertion.
|
||||
@@ -2753,7 +2751,6 @@ func benchmarkLargeNumberOfValueToNonexisting(b *testing.B, numTxs, numBlocks in
|
||||
b.StopTimer()
|
||||
if got := chain.CurrentBlock().Transactions().Len(); got != numTxs*numBlocks {
|
||||
b.Fatalf("Transactions were not included, expected %d, got %d", numTxs*numBlocks, got)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3522,7 +3519,6 @@ func TestEIP2718Transition(t *testing.T) {
|
||||
vm.GasQuickStep*2 + params.WarmStorageReadCostEIP2929 + params.ColdSloadCostEIP2929
|
||||
if block.GasUsed() != expected {
|
||||
t.Fatalf("incorrect amount of gas spent: expected %d, got %d", expected, block.GasUsed())
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -332,7 +332,6 @@ func BenchmarkFlatten(b *testing.B) {
|
||||
value := make([]byte, 32)
|
||||
rand.Read(value)
|
||||
accStorage[randomHash()] = value
|
||||
|
||||
}
|
||||
storage[accountKey] = accStorage
|
||||
}
|
||||
@@ -382,7 +381,6 @@ func BenchmarkJournal(b *testing.B) {
|
||||
value := make([]byte, 32)
|
||||
rand.Read(value)
|
||||
accStorage[randomHash()] = value
|
||||
|
||||
}
|
||||
storage[accountKey] = accStorage
|
||||
}
|
||||
|
||||
@@ -699,7 +699,6 @@ func TestDeleteCreateRevert(t *testing.T) {
|
||||
// the Commit operation fails with an error
|
||||
// If we are missing trie nodes, we should not continue writing to the trie
|
||||
func TestMissingTrieNodes(t *testing.T) {
|
||||
|
||||
// Create an initial state with a few accounts
|
||||
memDb := rawdb.NewMemoryDatabase()
|
||||
db := NewDatabase(memDb)
|
||||
|
||||
@@ -669,7 +669,6 @@ func TestTransactionPostponing(t *testing.T) {
|
||||
// Add a batch consecutive pending transactions for validation
|
||||
txs := []*types.Transaction{}
|
||||
for i, key := range keys {
|
||||
|
||||
for j := 0; j < 100; j++ {
|
||||
var tx *types.Transaction
|
||||
if (i+j)%2 == 0 {
|
||||
|
||||
@@ -92,7 +92,6 @@ func BenchmarkBloom9Lookup(b *testing.B) {
|
||||
}
|
||||
|
||||
func BenchmarkCreateBloom(b *testing.B) {
|
||||
|
||||
var txs = Transactions{
|
||||
NewContractCreation(1, big.NewInt(1), 1, big.NewInt(1), nil),
|
||||
NewTransaction(2, common.HexToAddress("0x2"), big.NewInt(2), 2, big.NewInt(2), nil),
|
||||
|
||||
@@ -111,7 +111,6 @@ func TestEIP155SigningVitalik(t *testing.T) {
|
||||
if from != addr {
|
||||
t.Errorf("%d: expected %x got %x", i, addr, from)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,6 @@ func TestEIP2718TransactionSigHash(t *testing.T) {
|
||||
|
||||
// This test checks signature operations on access list transactions.
|
||||
func TestEIP2930Signer(t *testing.T) {
|
||||
|
||||
var (
|
||||
key, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
||||
keyAddr = crypto.PubkeyToAddress(key.PublicKey)
|
||||
|
||||
@@ -46,7 +46,6 @@ var commonParams []*twoOperandParams
|
||||
var twoOpMethods map[string]executionFunc
|
||||
|
||||
func init() {
|
||||
|
||||
// Params is a list of common edgecases that should be used for some common tests
|
||||
params := []string{
|
||||
"0000000000000000000000000000000000000000000000000000000000000000", // 0
|
||||
@@ -92,7 +91,6 @@ func init() {
|
||||
}
|
||||
|
||||
func testTwoOperandOp(t *testing.T, tests []TwoOperandTestcase, opFn executionFunc, name string) {
|
||||
|
||||
var (
|
||||
env = NewEVM(BlockContext{}, TxContext{}, nil, params.TestChainConfig, Config{})
|
||||
stack = newstack()
|
||||
@@ -641,7 +639,6 @@ func TestCreate2Addreses(t *testing.T) {
|
||||
expected: "0xE33C0C7F7df4809055C3ebA6c09CFe4BaF1BD9e0",
|
||||
},
|
||||
} {
|
||||
|
||||
origin := common.BytesToAddress(common.FromHex(tt.origin))
|
||||
salt := common.BytesToHash(common.FromHex(tt.salt))
|
||||
code := common.FromHex(tt.code)
|
||||
|
||||
@@ -114,7 +114,6 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter {
|
||||
// considered a revert-and-consume-all-gas operation except for
|
||||
// ErrExecutionReverted which means revert-and-keep-gas-left.
|
||||
func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (ret []byte, err error) {
|
||||
|
||||
// Increment the call depth which is restricted to 1024
|
||||
in.evm.depth++
|
||||
defer func() { in.evm.depth-- }()
|
||||
|
||||
@@ -73,5 +73,4 @@ func TestLoopInterrupt(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -198,7 +198,6 @@ func newSpuriousDragonInstructionSet() JumpTable {
|
||||
instructionSet := newTangerineWhistleInstructionSet()
|
||||
instructionSet[EXP].dynamicGas = gasExpEIP158
|
||||
return validate(instructionSet)
|
||||
|
||||
}
|
||||
|
||||
// EIP 150 a.k.a Tangerine Whistle
|
||||
|
||||
@@ -379,7 +379,6 @@ func benchmarkNonModifyingCode(gas uint64, code []byte, name string, tracerCode
|
||||
// BenchmarkSimpleLoop test a pretty simple loop which loops until OOG
|
||||
// 55 ms
|
||||
func BenchmarkSimpleLoop(b *testing.B) {
|
||||
|
||||
staticCallIdentity := []byte{
|
||||
byte(vm.JUMPDEST), // [ count ]
|
||||
// push args for the call
|
||||
@@ -498,7 +497,6 @@ func TestEip2929Cases(t *testing.T) {
|
||||
t.Skip("Test only useful for generating documentation")
|
||||
id := 1
|
||||
prettyPrint := func(comment string, code []byte) {
|
||||
|
||||
instrs := make([]string, 0)
|
||||
it := asm.NewInstructionIterator(code)
|
||||
for it.Next() {
|
||||
|
||||
Reference in New Issue
Block a user