Skip to content

Commit

Permalink
refactor: fixed vote tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Yashk767 committed Apr 26, 2024
1 parent 73f411a commit 98d0e1a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/vote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ func TestHandleBlock(t *testing.T) {
clientUtilsMock.On("BalanceAtWithRetry", mock.AnythingOfType("*ethclient.Client"), mock.Anything).Return(tt.args.ethBalance, tt.args.ethBalanceErr)
utilsMock.On("GetStakerSRZRBalance", mock.Anything, mock.Anything).Return(tt.args.sRZRBalance, tt.args.sRZRBalanceErr)
osMock.On("Exit", mock.AnythingOfType("int")).Return()
cmdUtilsMock.On("InitiateCommit", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(tt.args.initiateCommitErr)
cmdUtilsMock.On("InitiateCommit", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(tt.args.initiateCommitErr)
cmdUtilsMock.On("InitiateReveal", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(tt.args.initiateRevealErr)
cmdUtilsMock.On("InitiatePropose", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(tt.args.initiateProposeErr)
cmdUtilsMock.On("HandleDispute", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(tt.args.handleDisputeErr)
Expand All @@ -1240,6 +1240,7 @@ func TestVote(t *testing.T) {
rogueData types.Rogue
account types.Account
stakerId uint32
httpClient *clientPkg.HttpClient
backupNodeActionsToIgnore []string
)
type args struct {
Expand Down Expand Up @@ -1274,7 +1275,7 @@ func TestVote(t *testing.T) {
errChan := make(chan error)
// Run Vote function in a goroutine
go func() {
errChan <- ut.Vote(ctx, config, client, rogueData, account, stakerId, backupNodeActionsToIgnore)
errChan <- ut.Vote(ctx, config, client, account, stakerId, httpClient, rogueData, backupNodeActionsToIgnore)
}()

// Wait for some time to allow Vote function to execute
Expand Down

0 comments on commit 98d0e1a

Please sign in to comment.