Skip to content

Commit

Permalink
Match against the error string instead
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippGackstatter committed Apr 18, 2024
1 parent 2697875 commit 5fc68db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func (o *SybilProtection) slotFinalized(slot iotago.SlotIndex) {
if err != nil {
panic(ierrors.Wrap(err, "error while selecting new committee"))
}
o.LogDebugf("NewCommitteeSelected of size %d", len(newCommittee. IDs()))
o.LogDebugf("NewCommitteeSelected of size %d", len(newCommittee.IDs()))
o.events.CommitteeSelected.Trigger(newCommittee, epoch+1)
}
}
Expand Down
3 changes: 2 additions & 1 deletion tools/docker-network/tests/api_management_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ func Test_ManagementAPI_Pruning(t *testing.T) {

// prune database by size
pruneDatabaseResponse, err := managementClient.PruneDatabaseBySize(getContextWithTimeout(5*time.Second), "5G")
require.ErrorIs(t, err, database.ErrNoPruningNeeded)
// Match the error string since the error chain is lost during the HTTP request.
require.Contains(t, err.Error(), database.ErrNoPruningNeeded.Error())
require.Nil(t, pruneDatabaseResponse)
},
},
Expand Down

0 comments on commit 5fc68db

Please sign in to comment.