Skip to content

Commit

Permalink
fix tengateway test
Browse files Browse the repository at this point in the history
  • Loading branch information
badgersrus committed Jul 29, 2024
1 parent 9c06990 commit ddf13a0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 2 additions & 0 deletions integration/eth2network/build_number.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"strconv"
)

// Need this due to character limit on unix path when deploying the geth network on azure and integration tests. We
// incremenet the build number up to 9999 and then reset to 1, overwriting any existing files.
func getBuildNumber() (int, error) {
buildNumberStr := os.Getenv("BUILD_NUMBER")
var buildNumber int
Expand Down
5 changes: 2 additions & 3 deletions integration/tengateway/tengateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,6 @@ func testErrorHandling(t *testing.T, httpURL, wsURL string, w wallet.Wallet) {
require.NoError(t, err)

// make requests to geth for comparison

for _, req := range []string{
`{"jsonrpc":"2.0","method":"eth_getLogs","params":[[]],"id":1}`,
`{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"topics":[]}],"id":1}`,
Expand All @@ -511,7 +510,7 @@ func testErrorHandling(t *testing.T, httpURL, wsURL string, w wallet.Wallet) {
`{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x0000000000000000000000000000000000000000000000000000000000000000"],"id":1}`,
`{"jsonrpc":"2.0","method":"eth_maxPriorityFeePerGas","params":[],"id":1}`,
} {
// ensure the geth request is issued correctly (should return 200 ok with jsonRPCError)
// ensure the gateway request is issued correctly (should return 200 ok with jsonRPCError)
_, response, err := httputil.PostDataJSON(ogClient.HTTP(), []byte(req))
require.NoError(t, err)
fmt.Printf("Resp: %s", response)
Expand All @@ -521,7 +520,7 @@ func testErrorHandling(t *testing.T, httpURL, wsURL string, w wallet.Wallet) {
err = json.Unmarshal(response, &jsonRPCError)
require.NoError(t, err, req, response)

// repeat the process for the gateway
// repeat the process for geth
_, response, err = httputil.PostDataJSON(fmt.Sprintf("http://localhost:%d", _startPort+integration.DefaultGethHTTPPortOffset), []byte(req))
require.NoError(t, err)

Expand Down
5 changes: 0 additions & 5 deletions testnet/launcher/l1contractdeployer/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ func (n *ContractDeployer) RetrieveL1ContractAddresses() (*node.NetworkConfig, e
// make sure the container has finished execution (3 minutes allows time for L1 transactions to be mined)
err = docker.WaitForContainerToFinish(n.containerID, 3*time.Minute)
if err != nil {
println("HERE2")
return nil, err
}

Expand All @@ -94,7 +93,6 @@ func (n *ContractDeployer) RetrieveL1ContractAddresses() (*node.NetworkConfig, e
// Read the container logs
out, err := cli.ContainerLogs(context.Background(), n.containerID, logsOptions)
if err != nil {
println("HERE3")
return nil, err
}
defer out.Close()
Expand All @@ -103,7 +101,6 @@ func (n *ContractDeployer) RetrieveL1ContractAddresses() (*node.NetworkConfig, e
var buf bytes.Buffer
_, err = io.Copy(&buf, out)
if err != nil {
println("HERE4")
return nil, err
}

Expand All @@ -120,12 +117,10 @@ func (n *ContractDeployer) RetrieveL1ContractAddresses() (*node.NetworkConfig, e

managementAddr, err := findAddress(lines[0])
if err != nil {
println("HERE5")
return nil, err
}
messageBusAddr, err := findAddress(lines[1])
if err != nil {
println("HERE6")
return nil, err
}
l1BlockHash := readValue("L1Start", lines[2])
Expand Down

0 comments on commit ddf13a0

Please sign in to comment.