mirror of
https://github.com/AthanorLabs/atomic-swap.git
synced 2026-01-09 14:18:03 -05:00
feat: implement swap relayer cmd package (#282)
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user