Skip to content

Commit

Permalink
fix testcase syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
temaniarpit27 committed Sep 20, 2023
1 parent feea10a commit 3626e5f
Show file tree
Hide file tree
Showing 37 changed files with 2,786 additions and 3,137 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ ios:
@echo "Import \"$(GOBIN)/Geth.framework\" to use the library."

test:
$(GOTEST) --timeout 5m -cover -short -coverprofile=cover.out -covermode=atomic $(TESTALL)
$(GOTEST) --timeout 15m -cover -short -coverprofile=cover.out -covermode=atomic $(TESTALL)

test-txpool-race:
$(GOTEST) -run=TestPoolMiningDataRaces --timeout 600m -race -v ./core/
Expand Down
2 changes: 1 addition & 1 deletion common/gererics/empty.go → common/generics/empty.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gererics
package generics

func Empty[T any]() (t T) {
return
Expand Down
2 changes: 1 addition & 1 deletion core/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ func benchReadChain(b *testing.B, full bool, count uint64) {
makeChainForBench(db, full, count)
db.Close()

cacheConfig := *DefaultCacheConfig
cacheConfig := *defaultCacheConfig
cacheConfig.TrieDirtyDisabled = true

b.ReportAllocs()
Expand Down
10 changes: 6 additions & 4 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ type CacheConfig struct {
SnapshotWait bool // Wait for snapshot construction on startup. TODO(karalabe): This is a dirty hack for testing, nuke it
}

// DefaultCacheConfig are the default caching values if none are specified by the
// defaultCacheConfig are the default caching values if none are specified by the
// user (also used during testing).
var DefaultCacheConfig = &CacheConfig{
var defaultCacheConfig = &CacheConfig{
TrieCleanLimit: 256,
TrieDirtyLimit: 256,
TrieTimeLimit: 5 * time.Minute,
Expand All @@ -168,6 +168,8 @@ var DefaultCacheConfig = &CacheConfig{
TriesInMemory: 1024,
}

var DefaultCacheConfig = defaultCacheConfig

// BlockChain represents the canonical chain given a database with a genesis
// block. The Blockchain manages chain imports, reverts, chain reorganisations.
//
Expand Down Expand Up @@ -257,11 +259,11 @@ type BlockChain struct {
//nolint:gocognit
func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis, overrides *ChainOverrides, engine consensus.Engine, vmConfig vm.Config, shouldPreserve func(header *types.Header) bool, txLookupLimit *uint64, checker ethereum.ChainValidator) (*BlockChain, error) {
if cacheConfig == nil {
cacheConfig = DefaultCacheConfig
cacheConfig = defaultCacheConfig
}

if cacheConfig.TriesInMemory <= 0 {
cacheConfig.TriesInMemory = DefaultCacheConfig.TriesInMemory
cacheConfig.TriesInMemory = defaultCacheConfig.TriesInMemory
}
// Open trie database with provided config
triedb := trie.NewDatabaseWithConfig(db, &trie.Config{
Expand Down
Loading

0 comments on commit 3626e5f

Please sign in to comment.