Skip to content

Commit

Permalink
ci(repo): update go mod and use random port (#18515)
Browse files Browse the repository at this point in the history
  • Loading branch information
mask-pp authored Nov 25, 2024
1 parent ac7eba6 commit 3c2e943
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG PACKAGE=eventindexer

FROM golang:1.23.0 as builder
FROM golang:1.23.0 AS builder

ARG PACKAGE

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ require (
github.com/go-resty/resty/v2 v2.16.2
github.com/gomarkdown/markdown v0.0.0-20231222211730-1d6d20845b47
github.com/google/uuid v1.6.0
github.com/gorilla/websocket v1.5.3
github.com/joho/godotenv v1.5.1
github.com/labstack/echo-contrib v0.17.1
github.com/labstack/echo/v4 v4.12.0
Expand Down Expand Up @@ -119,7 +120,6 @@ require (
github.com/google/gofuzz v1.2.1-0.20220503160820-4a35382e8fc8 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/hashicorp/go-bexpr v0.1.11 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
Expand Down
9 changes: 4 additions & 5 deletions packages/eventindexer/pkg/repo/containers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ var (

func testMysql(t *testing.T) (db.DB, func(), error) {
req := testcontainers.ContainerRequest{
Image: "mysql:8.0.33",
ExposedPorts: []string{"3306/tcp", "33060/tcp"},
Image: "mysql:latest",
ExposedPorts: []string{"3306/tcp"},
Env: map[string]string{
"MYSQL_ROOT_PASSWORD": dbPassword,
"MYSQL_DATABASE": dbName,
Expand All @@ -51,11 +51,10 @@ func testMysql(t *testing.T) (db.DB, func(), error) {
}

host, _ := mysqlC.Host(ctx)
p, _ := mysqlC.MappedPort(ctx, "3306/tcp")
port := p.Int()
port, _ := mysqlC.MappedPort(ctx, "3306/tcp")

dsn := fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?tls=skip-verify&parseTime=true&multiStatements=true",
dbUsername, dbPassword, host, port, dbName)
dbUsername, dbPassword, host, port.Int(), dbName)

gormDB, err := gorm.Open(mysql.Open(dsn), &gorm.Config{
Logger: logger.Default.LogMode(logger.Silent),
Expand Down
3 changes: 2 additions & 1 deletion packages/eventindexer/pkg/repo/erc20_balance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package repo

import (
"context"
"errors"
"net/http"
"testing"

Expand Down Expand Up @@ -31,7 +32,7 @@ func Test_NewERC20BalanceRepo(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
_, err := NewERC20BalanceRepository(tt.db)
if err != tt.wantErr {
if !errors.Is(err, tt.wantErr) {
t.Errorf("NewERC20BalanceRepository() error = %v, wantErr %v", err, tt.wantErr)
return
}
Expand Down
5 changes: 5 additions & 0 deletions packages/taiko-client/pkg/rpc/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,11 @@ func (c *Client) CalculateBaseFee(
return nil, fmt.Errorf("failed to fetch parent gas excess: %w", err)
}
}
// The time of l1Head should always be greater than that of l2Head.
// Since the block.Time after anvil rollback is smaller than the original one, the timestamp has to be modified here.
if currentTimestamp < l2Head.Time {
currentTimestamp = l2Head.Time + 1
}
baseFeeInfo, err = c.TaikoL2.CalculateBaseFee(
&bind.CallOpts{BlockNumber: l2Head.Number, Context: ctx},
*baseFeeConfig,
Expand Down

0 comments on commit 3c2e943

Please sign in to comment.