Skip to content

Commit

Permalink
Merge branch 'develop' into fix-typos
Browse files Browse the repository at this point in the history
  • Loading branch information
nnsW3 authored Dec 13, 2023
2 parents 6c8155f + b8c463f commit 3047164
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion common/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"runtime/debug"
)

var tag = "v4.3.43"
var tag = "v4.3.44"

var commit = func() string {
if info, ok := debug.ReadBuildInfo(); ok {
Expand Down
7 changes: 7 additions & 0 deletions rollup/internal/controller/relayer/relayer_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package relayer

import (
"crypto/rand"
"encoding/json"
"math/big"
"os"
"strconv"
"testing"

"github.com/scroll-tech/go-ethereum/common"
Expand Down Expand Up @@ -52,6 +55,10 @@ func setupEnv(t *testing.T) {
MaxOpenNum: base.DBConfig.MaxOpenNum,
MaxIdleNum: base.DBConfig.MaxIdleNum,
}
port, err := rand.Int(rand.Reader, big.NewInt(10000))
assert.NoError(t, err)
svrPort := strconv.FormatInt(port.Int64()+50000, 10)
cfg.L2Config.RelayerConfig.ChainMonitor.BaseURL = "http://localhost:" + svrPort

// Create l2geth client.
l2Cli, err = base.L2Client()
Expand Down
8 changes: 8 additions & 0 deletions rollup/tests/bridge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ package tests

import (
"context"
"crypto/rand"
"math/big"
"net/http"
"strconv"
"strings"
"testing"

Expand Down Expand Up @@ -84,6 +87,11 @@ func setupEnv(t *testing.T) {

l2Auth, err = bind.NewKeyedTransactorWithChainID(rollupApp.Config.L1Config.RelayerConfig.GasOracleSenderPrivateKey, base.L2gethImg.ChainID())
assert.NoError(t, err)

port, err := rand.Int(rand.Reader, big.NewInt(10000))
assert.NoError(t, err)
svrPort := strconv.FormatInt(port.Int64()+40000, 10)
rollupApp.Config.L2Config.RelayerConfig.ChainMonitor.BaseURL = "http://localhost:" + svrPort
}

func mockChainMonitorServer(baseURL string) (*http.Server, error) {
Expand Down
12 changes: 6 additions & 6 deletions rollup/tests/process_start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ func testProcessStartEnableMetrics(t *testing.T) {
db := setupDB(t)
defer database.CloseDB(db)

port, err := rand.Int(rand.Reader, big.NewInt(2000))
port, err := rand.Int(rand.Reader, big.NewInt(10000))
assert.NoError(t, err)
svrPort := strconv.FormatInt(port.Int64()+50000, 10)
svrPort := strconv.FormatInt(port.Int64()+10000, 10)
rollupApp.RunApp(t, cutils.EventWatcherApp, "--metrics", "--metrics.addr", "localhost", "--metrics.port", svrPort)

port, err = rand.Int(rand.Reader, big.NewInt(2000))
port, err = rand.Int(rand.Reader, big.NewInt(10000))
assert.NoError(t, err)
svrPort = strconv.FormatInt(port.Int64()+50000, 10)
svrPort = strconv.FormatInt(port.Int64()+20000, 10)
rollupApp.RunApp(t, cutils.GasOracleApp, "--metrics", "--metrics.addr", "localhost", "--metrics.port", svrPort)

port, err = rand.Int(rand.Reader, big.NewInt(2000))
port, err = rand.Int(rand.Reader, big.NewInt(10000))
assert.NoError(t, err)
svrPort = strconv.FormatInt(port.Int64()+50000, 10)
svrPort = strconv.FormatInt(port.Int64()+30000, 10)
rollupApp.RunApp(t, cutils.RollupRelayerApp, "--metrics", "--metrics.addr", "localhost", "--metrics.port", svrPort)

rollupApp.WaitExit()
Expand Down

0 comments on commit 3047164

Please sign in to comment.