feat: implement swap relayer cmd package (#282)

This commit is contained in:
noot
2023-01-25 01:17:55 -05:00
committed by GitHub
parent af08415254
commit ea43b6a86c
21 changed files with 885 additions and 102 deletions

View File

@@ -81,3 +81,31 @@ func TestGetVersion(t *testing.T) {
require.NotEmpty(t, GetVersion())
t.Log(GetVersion())
}
func Test_expandBootnodes(t *testing.T) {
cliNodes := []string{
" node1, node2 ,node3,node4 ",
"node5",
"\tnode6\n",
"node7,node8",
}
expected := []string{
"node1",
"node2",
"node3",
"node4",
"node5",
"node6",
"node7",
"node8",
}
require.EqualValues(t, expected, ExpandBootnodes(cliNodes))
}
func Test_expandBootnodes_noNodes(t *testing.T) {
// This can happen when the user specifies a single `--bootnodes ""` flag
// to not use the default bootnodes for an environment.
cliNodes := []string{""}
nodes := ExpandBootnodes(cliNodes)
require.Zero(t, len(nodes))
}