Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ledger/allegra/rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package allegra_test
import (
"crypto/rand"
"encoding/hex"
"fmt"
"errors"
"testing"

"github.com/blinklabs-io/gouroboros/ledger/allegra"
Expand Down Expand Up @@ -48,7 +48,7 @@ func (ls testLedgerState) UtxoById(
}
return tmpUtxo, nil
}
return common.Utxo{}, fmt.Errorf("not found")
return common.Utxo{}, errors.New("not found")
}

func TestUtxoValidateOutsideValidityIntervalUtxo(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions ledger/mary/rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package mary_test
import (
"crypto/rand"
"encoding/hex"
"fmt"
"errors"
"testing"

"github.com/blinklabs-io/gouroboros/cbor"
Expand Down Expand Up @@ -50,7 +50,7 @@ func (ls testLedgerState) UtxoById(
}
return tmpUtxo, nil
}
return common.Utxo{}, fmt.Errorf("not found")
return common.Utxo{}, errors.New("not found")
}

func TestUtxoValidateOutsideValidityIntervalUtxo(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions ledger/shelley/rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package shelley_test
import (
"crypto/rand"
"encoding/hex"
"fmt"
"errors"
"testing"

"github.com/blinklabs-io/gouroboros/ledger/common"
Expand Down Expand Up @@ -47,7 +47,7 @@ func (ls testLedgerState) UtxoById(
}
return tmpUtxo, nil
}
return common.Utxo{}, fmt.Errorf("not found")
return common.Utxo{}, errors.New("not found")
}

func TestUtxoValidateTimeToLive(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions protocol/handshake/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func TestClientNtNAcceptV11(t *testing.T) {

func TestClientNtCRefuseVersionMismatch(t *testing.T) {
defer goleak.VerifyNone(t)
expectedErr := fmt.Sprintf("%s: version mismatch", handshake.ProtocolName)
expectedErr := handshake.ProtocolName + ": version mismatch"
mockConn := ouroboros_mock.NewConnection(
ouroboros_mock.ProtocolRoleClient,
[]ouroboros_mock.ConversationEntry{
Expand Down Expand Up @@ -282,7 +282,7 @@ func TestClientNtCRefuseVersionMismatch(t *testing.T) {

func TestClientNtCRefuseDecodeError(t *testing.T) {
defer goleak.VerifyNone(t)
expectedErr := fmt.Sprintf("%s: decode error: foo", handshake.ProtocolName)
expectedErr := handshake.ProtocolName + ": decode error: foo"
mockConn := ouroboros_mock.NewConnection(
ouroboros_mock.ProtocolRoleClient,
[]ouroboros_mock.ConversationEntry{
Expand Down Expand Up @@ -317,7 +317,7 @@ func TestClientNtCRefuseDecodeError(t *testing.T) {

func TestClientNtCRefuseRefused(t *testing.T) {
defer goleak.VerifyNone(t)
expectedErr := fmt.Sprintf("%s: refused: foo", handshake.ProtocolName)
expectedErr := handshake.ProtocolName + ": refused: foo"
mockConn := ouroboros_mock.NewConnection(
ouroboros_mock.ProtocolRoleClient,
[]ouroboros_mock.ConversationEntry{
Expand Down
7 changes: 3 additions & 4 deletions protocol/handshake/server_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Blink Labs Software
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -15,6 +15,7 @@
package handshake_test

import (
"errors"
"fmt"
"testing"
"time"
Expand Down Expand Up @@ -97,9 +98,7 @@ func TestServerHandshakeRefuseVersionMismatch(t *testing.T) {
defer func() {
goleak.VerifyNone(t)
}()
expectedErr := fmt.Errorf(
"handshake failed: refused due to version mismatch",
)
expectedErr := errors.New("handshake failed: refused due to version mismatch")
mockConn := ouroboros_mock.NewConnection(
ouroboros_mock.ProtocolRoleServer,
[]ouroboros_mock.ConversationEntry{
Expand Down
5 changes: 3 additions & 2 deletions protocol/keepalive/client_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Blink Labs Software
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -15,6 +15,7 @@
package keepalive_test

import (
"errors"
"fmt"
"testing"
"time"
Expand Down Expand Up @@ -142,7 +143,7 @@ func TestServerKeepaliveHandlingWithWrongResponse(t *testing.T) {
go func() {
err := <-mockConn.ErrorChan()
if err == nil {
asyncErrChan <- fmt.Errorf("did not receive expected error")
asyncErrChan <- errors.New("did not receive expected error")
} else {
if err.Error() != expectedErr {
asyncErrChan <- fmt.Errorf("did not receive expected error\n got: %s\n wanted: %s", err, expectedErr)
Expand Down
5 changes: 3 additions & 2 deletions protocol/localtxsubmission/client_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Blink Labs Software
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -15,6 +15,7 @@
package localtxsubmission_test

import (
"errors"
"fmt"
"testing"
"time"
Expand Down Expand Up @@ -129,7 +130,7 @@ func TestSubmitTxRject(t *testing.T) {
expectedErr := localtxsubmission.TransactionRejectedError{
// [0, [1, ["foo"]]]
ReasonCbor: test.DecodeHexString("820082018163666f6f"),
Reason: fmt.Errorf("GenericError ([0 [1 [foo]]])"),
Reason: errors.New("GenericError ([0 [1 [foo]]])"),
}
conversation := append(
conversationHandshakeSubmitTx,
Expand Down