Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
huy-nodeset committed Dec 11, 2024
1 parent 2552d72 commit 0c5ecca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
3 changes: 2 additions & 1 deletion internal/tests/api/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (

func TestValidatorStatus_Active(t *testing.T) {
err := testMgr.DependsOnStakewiseBaseline()
mainNode := testMgr.GetMainNode()

mainNode := testMgr.GetNode()
require.NoError(t, err)
// Get some resources
sp := mainNode.GetServiceProvider()
Expand Down
13 changes: 4 additions & 9 deletions testing/test-manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ type StakeWiseTestManager struct {
// The ID of the baseline snapshot
baselineSnapshotID string

mainNode *StakeWiseNode
mainNodeAddress common.Address
nsEmail string
}
Expand Down Expand Up @@ -117,13 +116,13 @@ func NewStakeWiseTestManager() (*StakeWiseTestManager, error) {

// Initialize test manager by generating a new wallet, starting the StakeWise node, and registering with NodeSet
func (m *StakeWiseTestManager) SetupTest() error {
m.mainNode = m.GetNode()
mainNode := m.GetNode()
m.nsEmail = "[email protected]"
// Generate a new wallet
derivationPath := string(wallet.DerivationPath_Default)
index := uint64(0)
password := "test_password123"
hdNode := m.mainNode.GetHyperdriveNode()
hdNode := mainNode.GetHyperdriveNode()
hd := hdNode.GetApiClient()
recoverResponse, err := hd.Wallet.Recover(&derivationPath, keys.DefaultMnemonic, &index, password, true)
if err != nil {
Expand All @@ -132,7 +131,7 @@ func (m *StakeWiseTestManager) SetupTest() error {
m.mainNodeAddress = recoverResponse.Data.AccountAddress

// Set up NodeSet with the StakeWise vault
sp := m.mainNode.GetServiceProvider()
sp := mainNode.GetServiceProvider()
res := sp.GetResources()
nsMgr := m.GetNodeSetMockServer().GetManager()
nsDB := nsMgr.GetDatabase()
Expand All @@ -147,7 +146,7 @@ func (m *StakeWiseTestManager) SetupTest() error {
}

// Register the primary
err = m.registerWithNodeset(m.mainNode, m.mainNodeAddress)
err = m.registerWithNodeset(mainNode, m.mainNodeAddress)
if err != nil {
return fmt.Errorf("error registering with nodeset: %v", err)
}
Expand All @@ -158,10 +157,6 @@ func (m *StakeWiseTestManager) SetupTest() error {
// === Getters ===
// ===============

func (m *StakeWiseTestManager) GetMainNode() *StakeWiseNode {
return m.mainNode
}

func (m *StakeWiseTestManager) GetModuleName() string {
return "hyperdrive-stakewise"
}
Expand Down

0 comments on commit 0c5ecca

Please sign in to comment.