Skip to content

Commit

Permalink
fixed UT
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsitrin committed Apr 14, 2024
1 parent db3324d commit 18e51c1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions settlement/dymension/dymension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ func TestPostBatch(t *testing.T) {
wg.Add(eventsCount)
// Reset the mock functions
testutil.UnsetMockFn(cosmosClientMock.On("BroadcastTx"))
testutil.UnsetMockFn(rollappQueryClientMock.On("LatestStateIndex"))
testutil.UnsetMockFn(rollappQueryClientMock.On("StateInfo"))
// Set the mock logic based on the test case
if !c.isBatchSubmitSuccess {
Expand All @@ -174,8 +173,6 @@ func TestPostBatch(t *testing.T) {
}
if c.shouldMockBatchIncluded {
if c.isBatchIncludedSuccess {
rollappQueryClientMock.On("LatestStateIndex", mock.Anything, mock.Anything).Return(
&rollapptypes.QueryGetLatestStateIndexResponse{StateIndex: rollapptypes.StateInfoIndex{Index: 1}}, nil)
daMetaData := &da.DASubmitMetaData{
Height: 1,
Client: da.Mock,
Expand All @@ -186,7 +183,7 @@ func TestPostBatch(t *testing.T) {
}},
nil)
} else {
rollappQueryClientMock.On("LatestStateIndex", mock.Anything, mock.Anything).Return(nil, fmt.Errorf("error"))
rollappQueryClientMock.On("StateInfo", mock.Anything, mock.Anything).Return(nil, fmt.Errorf("error"))
}
}
hubClient, err := newDymensionHubClient(settlement.Config{}, pubsubServer, log.TestingLogger(), options...)
Expand Down

0 comments on commit 18e51c1

Please sign in to comment.