-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Aggregator: use sequenceBatch maxTimestamp as TimestampLimit (#84)
- Update to zkevm-synchronizer-l1 v1.0.1 - Check unexpected/deprecateds fields on config file
- Loading branch information
1 parent
1f1deee
commit faf88bb
Showing
5 changed files
with
172 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package config | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestLoadDeafaultConfig(t *testing.T) { | ||
tmpFile, err := os.CreateTemp("", "ut_config") | ||
require.NoError(t, err) | ||
defer os.Remove(tmpFile.Name()) | ||
_, err = tmpFile.Write([]byte(DefaultValues)) | ||
require.NoError(t, err) | ||
cfg, err := LoadFile(tmpFile.Name()) | ||
require.NoError(t, err) | ||
require.NotNil(t, cfg) | ||
} | ||
|
||
const configWithUnexpectedFields = ` | ||
[UnknownField] | ||
Field = "value" | ||
` | ||
|
||
func TestLoadConfigWithUnexpectedFields(t *testing.T) { | ||
tmpFile, err := os.CreateTemp("", "ut_config") | ||
require.NoError(t, err) | ||
defer os.Remove(tmpFile.Name()) | ||
_, err = tmpFile.Write([]byte(configWithUnexpectedFields)) | ||
require.NoError(t, err) | ||
cfg, err := LoadFile(tmpFile.Name()) | ||
require.NoError(t, err) | ||
require.NotNil(t, cfg) | ||
} | ||
|
||
const configWithForbiddenFields = ` | ||
[aggregator.synchronizer.db] | ||
name = "value" | ||
` | ||
|
||
func TestLoadConfigWithForbiddenFields(t *testing.T) { | ||
tmpFile, err := os.CreateTemp("", "ut_config") | ||
require.NoError(t, err) | ||
defer os.Remove(tmpFile.Name()) | ||
_, err = tmpFile.Write([]byte(configWithForbiddenFields)) | ||
require.NoError(t, err) | ||
cfg, err := LoadFile(tmpFile.Name()) | ||
require.NoError(t, err) | ||
require.NotNil(t, cfg) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.