diff --git a/ledger/common/script_test.go b/ledger/common/script_test.go index 54eebb5f..0c5609a6 100644 --- a/ledger/common/script_test.go +++ b/ledger/common/script_test.go @@ -33,6 +33,10 @@ func TestScriptRefDecode(t *testing.T) { t.Fatalf("unexpected error decoding script ref CBOR: %s", err) } if !reflect.DeepEqual(testScriptRef.Script, &expectedScript) { - t.Fatalf("did not get expected script\n got: %#v\n wanted: %#v", testScriptRef.Script, &expectedScript) + t.Fatalf( + "did not get expected script\n got: %#v\n wanted: %#v", + testScriptRef.Script, + &expectedScript, + ) } } diff --git a/ledger/conway/block_test.go b/ledger/conway/block_test.go index bee1e691..1d86451c 100644 --- a/ledger/conway/block_test.go +++ b/ledger/conway/block_test.go @@ -35,7 +35,10 @@ func TestConwayBlock_CborRoundTrip_UsingCborEncode(t *testing.T) { // Decode the hex string into CBOR bytes dataBytes, err := hex.DecodeString(hexStr) if err != nil { - t.Fatalf("Failed to decode Conway block hex string into CBOR bytes: %v", err) + t.Fatalf( + "Failed to decode Conway block hex string into CBOR bytes: %v", + err, + ) } // Deserialize CBOR bytes into ConwayBlock struct @@ -48,7 +51,10 @@ func TestConwayBlock_CborRoundTrip_UsingCborEncode(t *testing.T) { // Re-encode using the cbor Encode function encoded, err := cbor.Encode(block) if err != nil { - t.Fatalf("Failed to marshal ConwayBlock using custom encode function: %v", err) + t.Fatalf( + "Failed to marshal ConwayBlock using custom encode function: %v", + err, + ) } if encoded == nil || len(encoded) == 0 { t.Fatal("Custom encoded CBOR from ConwayBlock is nil or empty") @@ -56,7 +62,11 @@ func TestConwayBlock_CborRoundTrip_UsingCborEncode(t *testing.T) { // Ensure the original and re-encoded CBOR bytes are identical if !bytes.Equal(dataBytes, encoded) { - t.Errorf("Custom CBOR round-trip mismatch for Conway block\nOriginal CBOR (hex): %x\nCustom Encoded CBOR (hex): %x", dataBytes, encoded) + t.Errorf( + "Custom CBOR round-trip mismatch for Conway block\nOriginal CBOR (hex): %x\nCustom Encoded CBOR (hex): %x", + dataBytes, + encoded, + ) // Check from which byte it differs diffIndex := -1 @@ -68,7 +78,11 @@ func TestConwayBlock_CborRoundTrip_UsingCborEncode(t *testing.T) { } if diffIndex != -1 { t.Logf("First mismatch at byte index: %d", diffIndex) - t.Logf("Original byte: 0x%02x, Re-encoded byte: 0x%02x", dataBytes[diffIndex], encoded[diffIndex]) + t.Logf( + "Original byte: 0x%02x, Re-encoded byte: 0x%02x", + dataBytes[diffIndex], + encoded[diffIndex], + ) } else { t.Logf("Length mismatch: original length = %d, re-encoded length = %d", len(dataBytes), len(encoded)) } diff --git a/muxer/muxer.go b/muxer/muxer.go index 244cf85b..ea384770 100644 --- a/muxer/muxer.go +++ b/muxer/muxer.go @@ -75,7 +75,11 @@ type ConnectionClosedError struct { } func (e *ConnectionClosedError) Error() string { - return fmt.Sprintf("peer closed the connection while %s: %v", e.Context, e.Err) + return fmt.Sprintf( + "peer closed the connection while %s: %v", + e.Context, + e.Err, + ) } func (e *ConnectionClosedError) Unwrap() error { @@ -301,7 +305,9 @@ func (m *Muxer) readLoop() { err = io.EOF } if errors.Is(err, io.EOF) { - m.sendError(&ConnectionClosedError{Context: "reading header", Err: err}) + m.sendError( + &ConnectionClosedError{Context: "reading header", Err: err}, + ) } else { m.sendError(err) } @@ -318,7 +324,12 @@ func (m *Muxer) readLoop() { err = io.EOF } if errors.Is(err, io.EOF) { - m.sendError(&ConnectionClosedError{Context: "reading payload", Err: err}) + m.sendError( + &ConnectionClosedError{ + Context: "reading payload", + Err: err, + }, + ) } else { m.sendError(err) } diff --git a/protocol/txsubmission/client.go b/protocol/txsubmission/client.go index e2dd18e3..d96d7641 100644 --- a/protocol/txsubmission/client.go +++ b/protocol/txsubmission/client.go @@ -128,7 +128,9 @@ func (c *Client) handleRequestTxIds(msg protocol.Message) error { return err } if !msgRequestTxIds.Blocking { - return errors.New("cannot stop server process during a non-blocking operation") + return errors.New( + "cannot stop server process during a non-blocking operation", + ) } resp := NewMsgDone() if err := c.SendMessage(resp); err != nil {