mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
test:delete-no-use-param
This commit is contained in:
parent
f5ab92b695
commit
60a2c0b9a9
4 changed files with 12 additions and 12 deletions
|
|
@ -361,7 +361,7 @@ func allTransactionTypes(addr common.Address, config *params.ChainConfig) []txDa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func allBlobTxs(addr common.Address, config *params.ChainConfig) []txData {
|
func allBlobTxs(addr common.Address, _ *params.ChainConfig) []txData {
|
||||||
return []txData{
|
return []txData{
|
||||||
{
|
{
|
||||||
Tx: &types.BlobTx{
|
Tx: &types.BlobTx{
|
||||||
|
|
@ -1244,7 +1244,7 @@ func TestFillBlobTransaction(t *testing.T) {
|
||||||
if len(tc.err) > 0 {
|
if len(tc.err) > 0 {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatalf("missing error. want: %s", tc.err)
|
t.Fatalf("missing error. want: %s", tc.err)
|
||||||
} else if err != nil && err.Error() != tc.err {
|
} else if err.Error() != tc.err {
|
||||||
t.Fatalf("error mismatch. want: %s, have: %s", tc.err, err.Error())
|
t.Fatalf("error mismatch. want: %s, have: %s", tc.err, err.Error())
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ func TestBuildPayload(t *testing.T) {
|
||||||
db = rawdb.NewMemoryDatabase()
|
db = rawdb.NewMemoryDatabase()
|
||||||
recipient = common.HexToAddress("0xdeadbeef")
|
recipient = common.HexToAddress("0xdeadbeef")
|
||||||
)
|
)
|
||||||
w, b := newTestWorker(t, params.TestChainConfig, ethash.NewFaker(), db, 0)
|
w, b := newTestWorker(t, params.TestChainConfig, ethash.NewFaker(), db)
|
||||||
defer w.close()
|
defer w.close()
|
||||||
|
|
||||||
timestamp := uint64(time.Now().Unix())
|
timestamp := uint64(time.Now().Unix())
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ type testWorkerBackend struct {
|
||||||
genesis *core.Genesis
|
genesis *core.Genesis
|
||||||
}
|
}
|
||||||
|
|
||||||
func newTestWorkerBackend(t *testing.T, chainConfig *params.ChainConfig, engine consensus.Engine, db ethdb.Database, n int) *testWorkerBackend {
|
func newTestWorkerBackend(t *testing.T, chainConfig *params.ChainConfig, engine consensus.Engine, db ethdb.Database) *testWorkerBackend {
|
||||||
var gspec = &core.Genesis{
|
var gspec = &core.Genesis{
|
||||||
Config: chainConfig,
|
Config: chainConfig,
|
||||||
Alloc: types.GenesisAlloc{testBankAddress: {Balance: testBankFunds}},
|
Alloc: types.GenesisAlloc{testBankAddress: {Balance: testBankFunds}},
|
||||||
|
|
@ -159,8 +159,8 @@ func (b *testWorkerBackend) newRandomTx(creation bool) *types.Transaction {
|
||||||
return tx
|
return tx
|
||||||
}
|
}
|
||||||
|
|
||||||
func newTestWorker(t *testing.T, chainConfig *params.ChainConfig, engine consensus.Engine, db ethdb.Database, blocks int) (*worker, *testWorkerBackend) {
|
func newTestWorker(t *testing.T, chainConfig *params.ChainConfig, engine consensus.Engine, db ethdb.Database) (*worker, *testWorkerBackend) {
|
||||||
backend := newTestWorkerBackend(t, chainConfig, engine, db, blocks)
|
backend := newTestWorkerBackend(t, chainConfig, engine, db)
|
||||||
backend.txPool.Add(pendingTxs, true, false)
|
backend.txPool.Add(pendingTxs, true, false)
|
||||||
w := newWorker(testConfig, chainConfig, engine, backend, new(event.TypeMux), nil, false)
|
w := newWorker(testConfig, chainConfig, engine, backend, new(event.TypeMux), nil, false)
|
||||||
w.setEtherbase(testBankAddress)
|
w.setEtherbase(testBankAddress)
|
||||||
|
|
@ -176,7 +176,7 @@ func TestGenerateAndImportBlock(t *testing.T) {
|
||||||
config.Clique = ¶ms.CliqueConfig{Period: 1, Epoch: 30000}
|
config.Clique = ¶ms.CliqueConfig{Period: 1, Epoch: 30000}
|
||||||
engine := clique.New(config.Clique, db)
|
engine := clique.New(config.Clique, db)
|
||||||
|
|
||||||
w, b := newTestWorker(t, &config, engine, db, 0)
|
w, b := newTestWorker(t, &config, engine, db)
|
||||||
defer w.close()
|
defer w.close()
|
||||||
|
|
||||||
// This test chain imports the mined blocks.
|
// This test chain imports the mined blocks.
|
||||||
|
|
@ -223,7 +223,7 @@ func TestEmptyWorkClique(t *testing.T) {
|
||||||
func testEmptyWork(t *testing.T, chainConfig *params.ChainConfig, engine consensus.Engine) {
|
func testEmptyWork(t *testing.T, chainConfig *params.ChainConfig, engine consensus.Engine) {
|
||||||
defer engine.Close()
|
defer engine.Close()
|
||||||
|
|
||||||
w, _ := newTestWorker(t, chainConfig, engine, rawdb.NewMemoryDatabase(), 0)
|
w, _ := newTestWorker(t, chainConfig, engine, rawdb.NewMemoryDatabase())
|
||||||
defer w.close()
|
defer w.close()
|
||||||
|
|
||||||
taskCh := make(chan struct{}, 2)
|
taskCh := make(chan struct{}, 2)
|
||||||
|
|
@ -268,7 +268,7 @@ func TestAdjustIntervalClique(t *testing.T) {
|
||||||
func testAdjustInterval(t *testing.T, chainConfig *params.ChainConfig, engine consensus.Engine) {
|
func testAdjustInterval(t *testing.T, chainConfig *params.ChainConfig, engine consensus.Engine) {
|
||||||
defer engine.Close()
|
defer engine.Close()
|
||||||
|
|
||||||
w, _ := newTestWorker(t, chainConfig, engine, rawdb.NewMemoryDatabase(), 0)
|
w, _ := newTestWorker(t, chainConfig, engine, rawdb.NewMemoryDatabase())
|
||||||
defer w.close()
|
defer w.close()
|
||||||
|
|
||||||
w.skipSealHook = func(task *task) bool {
|
w.skipSealHook = func(task *task) bool {
|
||||||
|
|
@ -372,7 +372,7 @@ func TestGetSealingWorkPostMerge(t *testing.T) {
|
||||||
func testGetSealingWork(t *testing.T, chainConfig *params.ChainConfig, engine consensus.Engine) {
|
func testGetSealingWork(t *testing.T, chainConfig *params.ChainConfig, engine consensus.Engine) {
|
||||||
defer engine.Close()
|
defer engine.Close()
|
||||||
|
|
||||||
w, b := newTestWorker(t, chainConfig, engine, rawdb.NewMemoryDatabase(), 0)
|
w, b := newTestWorker(t, chainConfig, engine, rawdb.NewMemoryDatabase())
|
||||||
defer w.close()
|
defer w.close()
|
||||||
|
|
||||||
w.setExtra([]byte{0x01, 0x02})
|
w.setExtra([]byte{0x01, 0x02})
|
||||||
|
|
|
||||||
|
|
@ -381,7 +381,7 @@ func TestStacktrieNotModifyValues(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildPartialTree(entries []*kv, t *testing.T) map[string]common.Hash {
|
func buildPartialTree(entries []*kv) map[string]common.Hash {
|
||||||
var (
|
var (
|
||||||
options = NewStackTrieOptions()
|
options = NewStackTrieOptions()
|
||||||
nodes = make(map[string]common.Hash)
|
nodes = make(map[string]common.Hash)
|
||||||
|
|
@ -456,7 +456,7 @@ func TestPartialStackTrie(t *testing.T) {
|
||||||
tr.Commit()
|
tr.Commit()
|
||||||
|
|
||||||
for j := 0; j < 100; j++ {
|
for j := 0; j < 100; j++ {
|
||||||
for path, hash := range buildPartialTree(entries, t) {
|
for path, hash := range buildPartialTree(entries) {
|
||||||
if nodes[path] != hash {
|
if nodes[path] != hash {
|
||||||
t.Errorf("%v, want %x, got %x", []byte(path), nodes[path], hash)
|
t.Errorf("%v, want %x, got %x", []byte(path), nodes[path], hash)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue