2022-01-20 13:22:01 +00:00
|
|
|
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-01-20 13:22:01 +00:00
|
|
|
|
2022-05-06 11:21:11 +00:00
|
|
|
"github.com/vulcanize/ipld-eth-server/pkg/eth"
|
2022-01-20 13:22:01 +00:00
|
|
|
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()
|
2022-01-20 13:22:01 +00:00
|
|
|
srvc := validator.NewService(db, uint64(contract.BlockNumber), trail, validator.IntegrationTestChainConfig)
|
|
|
|
_, err = srvc.Start(ctx)
|
|
|
|
Expect(err).ToNot(HaveOccurred())
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|