test:delete needless err check

This commit is contained in:
yzb@example.cn 2024-03-05 19:35:09 +08:00
parent dcf19c7e9e
commit 11c0169e71
2 changed files with 16 additions and 7 deletions

View file

@ -2345,7 +2345,7 @@ func testInsertKnownChainData(t *testing.T, typ string, scheme string) {
}
}
} else {
inserter = func(blocks []*types.Block, _ []types.Receipts) error {
inserter = func(blocks []*types.Block, receipts []types.Receipts) error {
_, err := chain.InsertChain(blocks)
return err
}
@ -2519,7 +2519,7 @@ func testInsertKnownChainDataWithMerging(t *testing.T, typ string, mergeHeight i
}
}
} else {
inserter = func(blocks []*types.Block, _ []types.Receipts) error {
inserter = func(blocks []*types.Block, receipts []types.Receipts) error {
i, err := chain.InsertChain(blocks)
if err != nil {
return fmt.Errorf("index %d: %w", i, err)
@ -2724,7 +2724,7 @@ func testReorgToShorterRemovesCanonMappingHeaderChain(t *testing.T, scheme strin
}
// Benchmarks large blocks with value transfers to non-existing accounts
func benchmarkLargeNumberOfValueToNonexisting(b *testing.B, numTxs, numBlocks int, recipientFn func(uint64) common.Address) {
func benchmarkLargeNumberOfValueToNonexisting(b *testing.B, numTxs, numBlocks int, recipientFn func(uint64) common.Address, dataFn func(uint64) []byte) {
var (
signer = types.HomesteadSigner{}
testBankKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
@ -2787,7 +2787,10 @@ func BenchmarkBlockChain_1x1000ValueTransferToNonexisting(b *testing.B) {
recipientFn := func(nonce uint64) common.Address {
return common.BigToAddress(new(big.Int).SetUint64(1337 + nonce))
}
benchmarkLargeNumberOfValueToNonexisting(b, numTxs, numBlocks, recipientFn)
dataFn := func(nonce uint64) []byte {
return nil
}
benchmarkLargeNumberOfValueToNonexisting(b, numTxs, numBlocks, recipientFn, dataFn)
}
func BenchmarkBlockChain_1x1000ValueTransferToExisting(b *testing.B) {
@ -2801,7 +2804,10 @@ func BenchmarkBlockChain_1x1000ValueTransferToExisting(b *testing.B) {
recipientFn := func(nonce uint64) common.Address {
return common.BigToAddress(new(big.Int).SetUint64(1337))
}
benchmarkLargeNumberOfValueToNonexisting(b, numTxs, numBlocks, recipientFn)
dataFn := func(nonce uint64) []byte {
return nil
}
benchmarkLargeNumberOfValueToNonexisting(b, numTxs, numBlocks, recipientFn, dataFn)
}
func BenchmarkBlockChain_1x1000Executions(b *testing.B) {
@ -2815,7 +2821,10 @@ func BenchmarkBlockChain_1x1000Executions(b *testing.B) {
recipientFn := func(nonce uint64) common.Address {
return common.BigToAddress(new(big.Int).SetUint64(0xc0de))
}
benchmarkLargeNumberOfValueToNonexisting(b, numTxs, numBlocks, recipientFn)
dataFn := func(nonce uint64) []byte {
return nil
}
benchmarkLargeNumberOfValueToNonexisting(b, numTxs, numBlocks, recipientFn, dataFn)
}
// Tests that importing a some old blocks, where all blocks are before the

View file

@ -361,7 +361,7 @@ func allTransactionTypes(addr common.Address, config *params.ChainConfig) []txDa
}
}
func allBlobTxs(addr common.Address, _ *params.ChainConfig) []txData {
func allBlobTxs(addr common.Address, config *params.ChainConfig) []txData {
return []txData{
{
Tx: &types.BlobTx{