diff --git a/node/pkg/accountant/accountant_test.go b/node/pkg/accountant/accountant_test.go index 4ddcb7bdd8..265cf89747 100644 --- a/node/pkg/accountant/accountant_test.go +++ b/node/pkg/accountant/accountant_test.go @@ -137,7 +137,7 @@ func newAccountantForTest( return acct } -// Converts a string into a go-ethereum Hash object used as test input. +// Converts a TxHash string into a byte array to be used as a TxID. func hashToTxID(str string) []byte { if (len(str) > 2) && (str[0] == '0') && (str[1] == 'x') { str = str[2:] diff --git a/node/pkg/common/chainlock.go b/node/pkg/common/chainlock.go index 68ce3fa9e5..54b0749189 100644 --- a/node/pkg/common/chainlock.go +++ b/node/pkg/common/chainlock.go @@ -5,6 +5,7 @@ import ( "encoding/binary" "encoding/hex" "encoding/json" + "errors" "fmt" "math" "time" @@ -52,7 +53,7 @@ func (msg *MessagePublication) Marshal() ([]byte, error) { buf := new(bytes.Buffer) if len(msg.TxID) > math.MaxUint8 { - return nil, fmt.Errorf("TxID too long") + return nil, errors.New("TxID too long") } vaa.MustWrite(buf, binary.BigEndian, uint8(len(msg.TxID))) buf.Write(msg.TxID) @@ -73,7 +74,7 @@ func (msg *MessagePublication) Marshal() ([]byte, error) { // This function can be deleted once all guardians have been upgraded. That's why the code is just duplicated. func UnmarshalOldMessagePublicationWithTxHash(data []byte) (*MessagePublication, error) { if len(data) < minMsgLength { - return nil, fmt.Errorf("message is too short") + return nil, errors.New("message is too short") } msg := &MessagePublication{} @@ -131,7 +132,7 @@ func UnmarshalOldMessagePublicationWithTxHash(data []byte) (*MessagePublication, // UnmarshalMessagePublication deserializes a MessagePublication func UnmarshalMessagePublication(data []byte) (*MessagePublication, error) { if len(data) < minMsgLength { - return nil, fmt.Errorf("message is too short") + return nil, errors.New("message is too short") } msg := &MessagePublication{} diff --git a/node/pkg/governor/governor_test.go b/node/pkg/governor/governor_test.go index f3b51a2342..a7fed811aa 100644 --- a/node/pkg/governor/governor_test.go +++ b/node/pkg/governor/governor_test.go @@ -697,7 +697,7 @@ func newChainGovernorForTestWithLogger(ctx context.Context, logger *zap.Logger) return gov, nil } -// Converts a string into a go-ethereum Hash object used as test input. +// Converts a TxHash string into a byte array to be used as a TxID. func hashToTxID(str string) []byte { if (len(str) > 2) && (str[0] == '0') && (str[1] == 'x') { str = str[2:]