Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(repo): fix some failed ci issues #18515

Merged
merged 7 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still think changing the code here is probly not the best way to resolve this test issue, let me figure out later.

currentTimestamp = l2Head.Time + 1
}
baseFeeInfo, err = c.TaikoL2.CalculateBaseFee(
&bind.CallOpts{BlockNumber: l2Head.Number, Context: ctx},
*baseFeeConfig,
Expand Down
Loading