ipld-eth-db-validator/test/integration_test.go

50 lines
1.2 KiB
Go
Raw Normal View History

package integration_test
import (
"context"
"os"
"strconv"
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
2022-05-06 11:21:11 +00:00
"github.com/vulcanize/ipld-eth-db-validator/pkg/validator"
2022-05-06 11:21:11 +00:00
"github.com/vulcanize/ipld-eth-server/pkg/eth"
integration "github.com/vulcanize/ipld-eth-server/test"
)
const trail = 0
var _ = Describe("Integration test", func() {
directProxyEthCalls, err := strconv.ParseBool(os.Getenv("ETH_FORWARD_ETH_CALLS"))
Expect(err).To(BeNil())
Expect(err).ToNot(HaveOccurred())
ctx := context.Background()
var contract *integration.ContractDeployed
var contractErr error
sleepInterval := 5 * time.Second
Describe("Validate state", func() {
BeforeEach(func() {
if directProxyEthCalls {
Skip("skipping no-direct-proxy-forwarding integration tests")
}
contract, contractErr = integration.DeployContract()
time.Sleep(sleepInterval)
})
It("Validate state root", func() {
Expect(contractErr).ToNot(HaveOccurred())
2022-05-06 11:21:11 +00:00
db := eth.SetupTestDB()
srvc := validator.NewService(db, uint64(contract.BlockNumber), trail, validator.IntegrationTestChainConfig)
_, err = srvc.Start(ctx)
Expect(err).ToNot(HaveOccurred())
})
})
})