-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(trie): Add support for trie V1 (#3433)
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Eclésio Junior <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
41e9c1d
commit 26f1611
Showing
81 changed files
with
1,561 additions
and
863 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,57 @@ | ||
// Copyright 2023 ChainSafe Systems (ON) | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
package commands | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestImportStateMissingStateFile(t *testing.T) { | ||
rootCmd, err := NewRootCommand() | ||
require.NoError(t, err) | ||
rootCmd.AddCommand(ImportStateCmd) | ||
|
||
rootCmd.SetArgs([]string{ImportStateCmd.Name()}) | ||
err = rootCmd.Execute() | ||
assert.ErrorContains(t, err, "state-file must be specified") | ||
} | ||
|
||
func TestImportStateInvalidFirstSlot(t *testing.T) { | ||
rootCmd, err := NewRootCommand() | ||
require.NoError(t, err) | ||
rootCmd.AddCommand(ImportStateCmd) | ||
|
||
rootCmd.SetArgs([]string{ImportStateCmd.Name(), "--first-slot", "wrong"}) | ||
err = rootCmd.Execute() | ||
assert.ErrorContains(t, err, "invalid argument \"wrong\"") | ||
} | ||
|
||
func TestImportStateEmptyHeaderFile(t *testing.T) { | ||
rootCmd, err := NewRootCommand() | ||
require.NoError(t, err) | ||
rootCmd.AddCommand(ImportStateCmd) | ||
|
||
rootCmd.SetArgs([]string{ImportStateCmd.Name(), | ||
"--state-file", "test", | ||
"--header-file", "", | ||
}) | ||
err = rootCmd.Execute() | ||
assert.ErrorContains(t, err, "header-file must be specified") | ||
} | ||
|
||
func TestImportStateErrorImportingState(t *testing.T) { | ||
rootCmd, err := NewRootCommand() | ||
require.NoError(t, err) | ||
rootCmd.AddCommand(ImportStateCmd) | ||
|
||
rootCmd.SetArgs([]string{ImportStateCmd.Name(), | ||
"--state-file", "test", | ||
"--header-file", "test", | ||
}) | ||
err = rootCmd.Execute() | ||
assert.ErrorContains(t, err, "no such file or directory") | ||
} |
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
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
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
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
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.