Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gitferry committed Dec 11, 2024
1 parent 889676b commit 83d46bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 9 additions & 4 deletions itest/e2e_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build e2e
// +build e2e

package e2etest

import (
Expand Down Expand Up @@ -236,7 +239,7 @@ func TestFinalityProviderEditCmd(t *testing.T) {
moniker = "test2-moniker"
args = []string{
fpIns.GetBtcPkHex(),
"--" + fpdDaemonAddressFlag, tm.FpConfig.RPCListener,
"--" + fpdDaemonAddressFlag, fpIns.GetConfig().RPCListener,
"--" + monikerFlag, moniker,
}

Expand All @@ -261,9 +264,11 @@ func TestFinalityProviderEditCmd(t *testing.T) {
}

func TestFinalityProviderCreateCmd(t *testing.T) {
tm, _ := StartManagerWithFinalityProvider(t, 1)
tm, fps := StartManagerWithFinalityProvider(t, 1)
defer tm.Stop(t)

fpIns := fps[0]

cmd := daemon.CommandCreateFP()

eotsKeyName := "eots-key-2"
Expand All @@ -284,7 +289,7 @@ func TestFinalityProviderCreateCmd(t *testing.T) {
Details string `json:"details"`
EotsPK string `json:"eotsPK"`
}{
KeyName: tm.FpConfig.BabylonConfig.Key,
KeyName: fpIns.GetConfig().BabylonConfig.Key,
ChainID: testChainID,
Passphrase: passphrase,
CommissionRate: "0.10",
Expand All @@ -310,7 +315,7 @@ func TestFinalityProviderCreateCmd(t *testing.T) {

cmd.SetArgs([]string{
"--from-file=" + file.Name(),
"--daemon-address=" + tm.FpConfig.RPCListener,
"--daemon-address=" + fpIns.GetConfig().RPCListener,
})

// Run the command
Expand Down
4 changes: 1 addition & 3 deletions itest/test_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,6 @@ func (tm *TestManager) AddFinalityProvider(t *testing.T) *service.FinalityProvid
err = fpServer.RunUntilShutdown()
require.NoError(t, err)
}()
// wait for the service to start
time.Sleep(5 * time.Second)

tm.Fps = append(tm.Fps, fpApp)

Expand Down Expand Up @@ -262,7 +260,7 @@ func (tm *TestManager) Stop(t *testing.T) {
require.NoError(t, err)
err = os.RemoveAll(tm.baseDir)
require.NoError(t, err)
tm.EOTSServerHandler.Stop()
// tm.EOTSServerHandler.Stop()
}

func (tm *TestManager) WaitForFpPubRandTimestamped(t *testing.T, fpIns *service.FinalityProviderInstance) {
Expand Down

0 comments on commit 83d46bf

Please sign in to comment.