diff --git a/pkg/eth/api_test.go b/pkg/eth/api_test.go index 57866cab..4e84f8b1 100644 --- a/pkg/eth/api_test.go +++ b/pkg/eth/api_test.go @@ -20,7 +20,6 @@ import ( "context" "math/big" "strconv" - "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -37,9 +36,10 @@ import ( sdtypes "github.com/ethereum/go-ethereum/statediff/types" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - pgipfsethdb "github.com/vulcanize/ipfs-ethdb/postgres" + "github.com/vulcanize/ipld-eth-server/pkg/eth" "github.com/vulcanize/ipld-eth-server/pkg/eth/test_helpers" + ethServerShared "github.com/vulcanize/ipld-eth-server/pkg/shared" ) var ( @@ -215,10 +215,12 @@ var _ = Describe("API", func() { ChainConfig: chainConfig, VmConfig: vm.Config{}, RPCGasCap: big.NewInt(10000000000), // Max gas capacity for a rpc call. - CacheConfig: pgipfsethdb.CacheConfig{ - Name: "api_test", - Size: 3000000, // 3MB - ExpiryDuration: time.Hour, + GroupCacheConfig: ðServerShared.GroupCacheConfig{ + StateDB: ethServerShared.GroupConfig{ + CacheSizeInMB: 8, + CacheExpiryInMins: 60, + LogStatsIntervalInSecs: 0, + }, }, }) Expect(err).ToNot(HaveOccurred()) diff --git a/pkg/eth/eth_state_test.go b/pkg/eth/eth_state_test.go index d8ba5e73..f8303090 100644 --- a/pkg/eth/eth_state_test.go +++ b/pkg/eth/eth_state_test.go @@ -21,7 +21,6 @@ import ( "context" "io/ioutil" "math/big" - "time" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" @@ -37,10 +36,10 @@ import ( sdtypes "github.com/ethereum/go-ethereum/statediff/types" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - pgipfsethdb "github.com/vulcanize/ipfs-ethdb/postgres" "github.com/vulcanize/ipld-eth-server/pkg/eth" "github.com/vulcanize/ipld-eth-server/pkg/eth/test_helpers" + ethServerShared "github.com/vulcanize/ipld-eth-server/pkg/shared" ) var ( @@ -82,10 +81,12 @@ var _ = Describe("eth state reading tests", func() { ChainConfig: chainConfig, VmConfig: vm.Config{}, RPCGasCap: big.NewInt(10000000000), // Max gas capacity for a rpc call. - CacheConfig: pgipfsethdb.CacheConfig{ - Name: "eth_state", - Size: 3000000, // 3MB - ExpiryDuration: time.Hour, + GroupCacheConfig: ðServerShared.GroupCacheConfig{ + StateDB: ethServerShared.GroupConfig{ + CacheSizeInMB: 8, + CacheExpiryInMins: 60, + LogStatsIntervalInSecs: 0, + }, }, }) Expect(err).ToNot(HaveOccurred()) diff --git a/pkg/graphql/graphql_test.go b/pkg/graphql/graphql_test.go index c3ca3b70..13f4a7dc 100644 --- a/pkg/graphql/graphql_test.go +++ b/pkg/graphql/graphql_test.go @@ -20,7 +20,6 @@ import ( "context" "fmt" "math/big" - "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -37,11 +36,11 @@ import ( sdtypes "github.com/ethereum/go-ethereum/statediff/types" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - pgipfsethdb "github.com/vulcanize/ipfs-ethdb/postgres" "github.com/vulcanize/ipld-eth-server/pkg/eth" "github.com/vulcanize/ipld-eth-server/pkg/eth/test_helpers" "github.com/vulcanize/ipld-eth-server/pkg/graphql" + ethServerShared "github.com/vulcanize/ipld-eth-server/pkg/shared" ) // SetupDB is use to setup a db for watcher tests @@ -87,10 +86,12 @@ var _ = Describe("GraphQL", func() { ChainConfig: chainConfig, VmConfig: vm.Config{}, RPCGasCap: big.NewInt(10000000000), - CacheConfig: pgipfsethdb.CacheConfig{ - Name: "graphql_test", - Size: 3000000, // 3MB - ExpiryDuration: time.Hour, + GroupCacheConfig: ðServerShared.GroupCacheConfig{ + StateDB: ethServerShared.GroupConfig{ + CacheSizeInMB: 8, + CacheExpiryInMins: 60, + LogStatsIntervalInSecs: 0, + }, }, }) Expect(err).ToNot(HaveOccurred())