Skip to content

Commit e0b5bab

Browse files
authored
fix: use %w in protocol tests (#924)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 18036d7 commit e0b5bab

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

protocol/blockfetch/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func runTest(
5656
go func() {
5757
err := <-mockConn.(*ouroboros_mock.Connection).ErrorChan()
5858
if err != nil {
59-
asyncErrChan <- fmt.Errorf("received unexpected error: %s", err)
59+
asyncErrChan <- fmt.Errorf("received unexpected error: %w", err)
6060
}
6161
close(asyncErrChan)
6262
}()

protocol/chainsync/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func runTest(
5858
go func() {
5959
err := <-mockConn.(*ouroboros_mock.Connection).ErrorChan()
6060
if err != nil {
61-
asyncErrChan <- fmt.Errorf("received unexpected error: %s", err)
61+
asyncErrChan <- fmt.Errorf("received unexpected error: %w", err)
6262
}
6363
close(asyncErrChan)
6464
}()

protocol/keepalive/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func TestServerKeepaliveHandlingWithWrongResponse(t *testing.T) {
146146
asyncErrChan <- errors.New("did not receive expected error")
147147
} else {
148148
if err.Error() != expectedErr {
149-
asyncErrChan <- fmt.Errorf("did not receive expected error\n got: %s\n wanted: %s", err, expectedErr)
149+
asyncErrChan <- fmt.Errorf("did not receive expected error\n got: %v\n wanted: %s", err, expectedErr)
150150
}
151151
}
152152
close(asyncErrChan)

protocol/localstatequery/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func runTest(
8080
go func() {
8181
err := <-mockConn.(*ouroboros_mock.Connection).ErrorChan()
8282
if err != nil {
83-
asyncErrChan <- fmt.Errorf("received unexpected error: %s", err)
83+
asyncErrChan <- fmt.Errorf("received unexpected error: %w", err)
8484
}
8585
close(asyncErrChan)
8686
}()

protocol/localtxmonitor/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func runTest(
6363
go func() {
6464
err := <-mockConn.(*ouroboros_mock.Connection).ErrorChan()
6565
if err != nil {
66-
asyncErrChan <- fmt.Errorf("received unexpected error: %s", err)
66+
asyncErrChan <- fmt.Errorf("received unexpected error: %w", err)
6767
}
6868
close(asyncErrChan)
6969
}()

protocol/localtxsubmission/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func runTest(
5555
go func() {
5656
err := <-mockConn.(*ouroboros_mock.Connection).ErrorChan()
5757
if err != nil {
58-
asyncErrChan <- fmt.Errorf("received unexpected error: %s", err)
58+
asyncErrChan <- fmt.Errorf("received unexpected error: %w", err)
5959
}
6060
close(asyncErrChan)
6161
}()

0 commit comments

Comments
 (0)