Skip to content

Commit

Permalink
fix: remove depracated fields (#222) (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
goran-ethernal authored Dec 4, 2024
1 parent 0051092 commit 229a5c2
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 23 deletions.
15 changes: 2 additions & 13 deletions aggsender/aggsender_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,12 @@ const (
var (
errTest = errors.New("unitest error")
ler1 = common.HexToHash("0x123")
ler2 = common.HexToHash("0x12345")
)

func TestConfigString(t *testing.T) {
config := Config{
StoragePath: "/path/to/storage",
AggLayerURL: "http://agglayer.url",
BlockGetInterval: types.Duration{Duration: 10 * time.Second},
CheckSettledInterval: types.Duration{Duration: 20 * time.Second},
AggsenderPrivateKey: types.KeystoreFileConfig{Path: "/path/to/key", Password: "password"},
URLRPCL2: "http://l2.rpc.url",
BlockFinality: "latestBlock",
Expand All @@ -52,8 +49,6 @@ func TestConfigString(t *testing.T) {

expected := "StoragePath: /path/to/storage\n" +
"AggLayerURL: http://agglayer.url\n" +
"BlockGetInterval: 10s\n" +
"CheckSettledInterval: 20s\n" +
"AggsenderPrivateKeyPath: /path/to/key\n" +
"URLRPCL2: http://l2.rpc.url\n" +
"BlockFinality: latestBlock\n" +
Expand Down Expand Up @@ -922,10 +917,7 @@ func TestCheckIfCertificatesAreSettled(t *testing.T) {
log: mockLogger,
storage: mockStorage,
aggLayerClient: mockAggLayerClient,
cfg: Config{
BlockGetInterval: types.Duration{Duration: time.Second},
CheckSettledInterval: types.Duration{Duration: time.Second},
},
cfg: Config{},
}

ctx := context.TODO()
Expand Down Expand Up @@ -1665,10 +1657,7 @@ func TestSendCertificate_NoClaims(t *testing.T) {
aggLayerClient: mockAggLayerClient,
l1infoTreeSyncer: mockL1InfoTreeSyncer,
sequencerKey: privateKey,
cfg: Config{
BlockGetInterval: types.Duration{Duration: time.Second},
CheckSettledInterval: types.Duration{Duration: time.Second},
},
cfg: Config{},
}

mockStorage.On("GetCertificatesByStatus", agglayer.NonSettledStatuses).Return([]*aggsendertypes.CertificateInfo{}, nil).Once()
Expand Down
6 changes: 0 additions & 6 deletions aggsender/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ type Config struct {
StoragePath string `mapstructure:"StoragePath"`
// AggLayerURL is the URL of the AggLayer
AggLayerURL string `mapstructure:"AggLayerURL"`
// BlockGetInterval is the interval at which the AggSender will get the blocks from L1
BlockGetInterval types.Duration `mapstructure:"BlockGetInterval"`
// CheckSettledInterval is the interval at which the AggSender will check if the blocks are settled
CheckSettledInterval types.Duration `mapstructure:"CheckSettledInterval"`
// AggsenderPrivateKey is the private key which is used to sign certificates
AggsenderPrivateKey types.KeystoreFileConfig `mapstructure:"AggsenderPrivateKey"`
// URLRPCL2 is the URL of the L2 RPC node
Expand Down Expand Up @@ -47,8 +43,6 @@ type Config struct {
func (c Config) String() string {
return "StoragePath: " + c.StoragePath + "\n" +
"AggLayerURL: " + c.AggLayerURL + "\n" +
"BlockGetInterval: " + c.BlockGetInterval.String() + "\n" +
"CheckSettledInterval: " + c.CheckSettledInterval.String() + "\n" +
"AggsenderPrivateKeyPath: " + c.AggsenderPrivateKey.Path + "\n" +
"URLRPCL2: " + c.URLRPCL2 + "\n" +
"BlockFinality: " + c.BlockFinality + "\n" +
Expand Down
2 changes: 0 additions & 2 deletions config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,7 @@ GlobalExitRootManagerAddr = "{{L1Config.polygonZkEVMGlobalExitRootAddress}}"
StoragePath = "{{PathRWData}}/aggsender.sqlite"
AggLayerURL = "{{AggLayerURL}}"
AggsenderPrivateKey = {Path = "{{SequencerPrivateKeyPath}}", Password = "{{SequencerPrivateKeyPassword}}"}
BlockGetInterval = "2s"
URLRPCL2="{{L2URL}}"
CheckSettledInterval = "2s"
BlockFinality = "LatestBlock"
EpochNotificationPercentage = 50
SaveCertificatesToFilesPath = ""
Expand Down
2 changes: 0 additions & 2 deletions test/config/kurtosis-cdk-node-config.toml.template
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ Outputs = ["stderr"]
SettlementBackend = "agglayer"

[AggSender]
CertificateSendInterval = "1m"
CheckSettledInterval = "5s"
SaveCertificatesToFilesPath = "{{.zkevm_path_rw_data}}/"


0 comments on commit 229a5c2

Please sign in to comment.