Skip to content

Commit

Permalink
Update jq test setup to work with both cancun and withdrawal tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brbrr committed Aug 21, 2024
1 parent 0c4fc95 commit 07ec97c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion simulators/ethereum/gnosis-engine-jq/Dockerfile.debug
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This simulation runs Engine API tests.
FROM golang:1.22-alpine as builder
FROM golang:1.20-alpine as builder
RUN apk add --update gcc musl-dev linux-headers


Expand Down
2 changes: 1 addition & 1 deletion simulators/ethereum/gnosis-engine-jq/globals/globals.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ var (
TestAccounts []*TestAccount

// Global test case timeout
DefaultTestCaseTimeout = time.Minute * 5
DefaultTestCaseTimeout = time.Minute * 10

// Confirmation blocks
PoWConfirmationBlocks = uint64(15)
Expand Down
10 changes: 8 additions & 2 deletions simulators/ethereum/gnosis-engine-jq/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,24 @@ func makeRunner(tests []test.Spec, nodeType string) func(t *hivesim.T) {

timestamp := new(big.Int).SetUint64(getTimestamp(currentTest))

if currentTest.GetMainFork() != "Cancun" {
globals.GenesisTimestamp = timestamp.Uint64()
}

// Load the genesis file specified and dynamically bundle it.
genesis := currentTest.GetGenesis()
forkConfig := currentTest.GetForkConfig()

cancunTimestamp := new(big.Int).Add(timestamp, big.NewInt(0))
shanghaiTimestamp := new(big.Int).Add(timestamp, big.NewInt(-1000000))
forkConfig.ShanghaiTimestamp = shanghaiTimestamp
forkConfig.CancunTimestamp = cancunTimestamp

if currentTest.GetMainFork() == "Cancun" {
forkConfig.ShanghaiTimestamp = forkConfig.CancunTimestamp
shanghaiTimestamp = forkConfig.CancunTimestamp
}

forkConfig.ShanghaiTimestamp = shanghaiTimestamp

if forkConfig == nil {
// Test cannot be configured as is for current fork, skip
fmt.Printf("skipping test \"%s\" because fork configuration is not possible\n", currentTestName)
Expand Down

0 comments on commit 07ec97c

Please sign in to comment.