Skip to content

Commit 55538d8

Browse files
committed
fix: ut
1 parent 8d9cab0 commit 55538d8

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

aggsender/aggsender_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
"github.com/agglayer/aggkit/grpc"
3131
"github.com/agglayer/aggkit/log"
3232
treetypes "github.com/agglayer/aggkit/tree/types"
33+
aggkittypes "github.com/agglayer/aggkit/types"
3334
"github.com/agglayer/go_signer/signer"
3435
signertypes "github.com/agglayer/go_signer/signer/types"
3536
"github.com/ethereum/go-ethereum/common"
@@ -51,6 +52,7 @@ func TestConfigString(t *testing.T) {
5152
EpochNotificationPercentage: 50,
5253
Mode: "PP",
5354
SovereignRollupAddr: common.HexToAddress("0x1"),
55+
BlockFinalityForL1InfoTree: aggkittypes.FinalizedBlock,
5456
}
5557

5658
expected := fmt.Sprintf("StoragePath: /path/to/storage\n"+
@@ -67,7 +69,8 @@ func TestConfigString(t *testing.T) {
6769
"SovereignRollupAddr: 0x0000000000000000000000000000000000000001\n"+
6870
"RequireNoFEPBlockGap: false\n"+
6971
"RetriesToBuildAndSendCertificate: RetryPolicyConfig{Mode: , Config: RetryDelaysConfig{Delays: [], MaxRetries: NO RETRIES}}\n"+
70-
"StorageRetainCertificatesPolicy: retain all certificates, keep history: false\n",
72+
"StorageRetainCertificatesPolicy: retain all certificates, keep history: false\n"+
73+
"BlockFinalityForL1InfoTree: FinalizedBlock\n",
7174
config.AgglayerClient.String())
7275

7376
require.Equal(t, expected, config.String())

aggsender/config/config_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/agglayer/aggkit/common"
1010
"github.com/agglayer/aggkit/config/types"
1111
"github.com/agglayer/aggkit/grpc"
12+
aggkittypes "github.com/agglayer/aggkit/types"
1213
signertypes "github.com/agglayer/go_signer/signer/types"
1314
ethCommon "github.com/ethereum/go-ethereum/common"
1415
"github.com/stretchr/testify/require"
@@ -29,6 +30,7 @@ func TestValidate(t *testing.T) {
2930
URL: "",
3031
},
3132
},
33+
BlockFinalityForL1InfoTree: aggkittypes.FinalizedBlock,
3234
},
3335
expectedErr: "invalid agglayer client config",
3436
},
@@ -44,6 +46,7 @@ func TestValidate(t *testing.T) {
4446
AggkitProverClient: &grpc.ClientConfig{
4547
URL: "",
4648
},
49+
BlockFinalityForL1InfoTree: aggkittypes.FinalizedBlock,
4750
},
4851
expectedErr: "invalid aggkit prover client config",
4952
},
@@ -59,6 +62,22 @@ func TestValidate(t *testing.T) {
5962
AggkitProverClient: &grpc.ClientConfig{
6063
URL: "",
6164
},
65+
BlockFinalityForL1InfoTree: aggkittypes.FinalizedBlock,
66+
},
67+
},
68+
{
69+
name: "nBlockFinalityForL1InfoTree not set",
70+
config: Config{
71+
Mode: aggsendertypes.PessimisticProofMode,
72+
AgglayerClient: agglayer.ClientConfig{GRPC: &grpc.ClientConfig{
73+
URL: "http://localhost:9090",
74+
MinConnectTimeout: types.NewDuration(5 * time.Second),
75+
},
76+
},
77+
AggkitProverClient: &grpc.ClientConfig{
78+
URL: "",
79+
},
80+
BlockFinalityForL1InfoTree: aggkittypes.FinalizedBlock,
6281
},
6382
},
6483
}

aggsender/validator/config_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
aggsendertypes "github.com/agglayer/aggkit/aggsender/types"
99
"github.com/agglayer/aggkit/config/types"
1010
"github.com/agglayer/aggkit/grpc"
11+
aggkittypes "github.com/agglayer/aggkit/types"
1112
"github.com/ethereum/go-ethereum/common"
1213
"github.com/stretchr/testify/require"
1314
)
@@ -28,6 +29,7 @@ func TestValidatorConfigValidate(t *testing.T) {
2829
URL: "http://localhost:9090",
2930
MinConnectTimeout: types.NewDuration(5 * time.Second),
3031
}},
32+
BlockFinalityForL1InfoTree: aggkittypes.FinalizedBlock,
3133
},
3234
},
3335
{
@@ -41,6 +43,7 @@ func TestValidatorConfigValidate(t *testing.T) {
4143
URL: "http://localhost:9090",
4244
MinConnectTimeout: types.NewDuration(5 * time.Second),
4345
}},
46+
BlockFinalityForL1InfoTree: aggkittypes.FinalizedBlock,
4447
},
4548
},
4649
{
@@ -54,6 +57,7 @@ func TestValidatorConfigValidate(t *testing.T) {
5457
URL: "http://localhost:9090",
5558
MinConnectTimeout: types.NewDuration(5 * time.Second),
5659
}},
60+
BlockFinalityForL1InfoTree: aggkittypes.FinalizedBlock,
5761
},
5862
expectedErr: errInvalidSovereignRollupAddr.Error(),
5963
},
@@ -65,6 +69,7 @@ func TestValidatorConfigValidate(t *testing.T) {
6569
URL: "http://localhost:9090",
6670
MinConnectTimeout: types.NewDuration(5 * time.Second),
6771
}},
72+
BlockFinalityForL1InfoTree: aggkittypes.FinalizedBlock,
6873
},
6974
expectedErr: "invalid mode invalid-mode, must be one of",
7075
},
@@ -76,6 +81,7 @@ func TestValidatorConfigValidate(t *testing.T) {
7681
URL: "http://localhost:9090",
7782
MinConnectTimeout: types.NewDuration(5 * time.Second),
7883
}},
84+
BlockFinalityForL1InfoTree: aggkittypes.FinalizedBlock,
7985
},
8086
expectedErr: "invalid mode , must be one of",
8187
},
@@ -86,6 +92,7 @@ func TestValidatorConfigValidate(t *testing.T) {
8692
AgglayerClient: agglayer.ClientConfig{GRPC: &grpc.ClientConfig{
8793
URL: "",
8894
}},
95+
BlockFinalityForL1InfoTree: aggkittypes.FinalizedBlock,
8996
},
9097
expectedErr: "invalid agglayer client config",
9198
},

0 commit comments

Comments
 (0)