From 3ddf3a6f225ba870b375edcef2c93b901d53edc4 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Tue, 10 Dec 2024 09:39:09 -0500 Subject: [PATCH] chore: make swagger format golines Signed-off-by: Chris Gianelloni --- internal/utxorpc/query.go | 20 ++++++++++++++++---- internal/utxorpc/submit.go | 13 +++++++++++-- openapi/api_default.go | 4 ++-- openapi/api_localstatequery.go | 24 ++++++++++++------------ openapi/api_localtxmonitor.go | 12 ++++++------ openapi/api_localtxsubmission.go | 4 ++-- 6 files changed, 49 insertions(+), 28 deletions(-) diff --git a/internal/utxorpc/query.go b/internal/utxorpc/query.go index 923cfb6..cd404e4 100644 --- a/internal/utxorpc/query.go +++ b/internal/utxorpc/query.go @@ -153,7 +153,9 @@ func (s *queryServiceServer) ReadUtxos( if isAllZeroes { // No actual datum; set Datum to nil to omit it audc.Cardano.Datum = nil - log.Print("Datum Hash is all zeroes; setting Datum to nil") + log.Print( + "Datum Hash is all zeroes; setting Datum to nil", + ) } else { log.Printf("Datum Hash present: %x", audc.Cardano.Datum.Hash) } @@ -167,7 +169,11 @@ func (s *queryServiceServer) ReadUtxos( Slot: point.Slot, Hash: point.Hash, } - log.Printf("Prepared response with LedgerTip: Slot=%v, Hash=%v", resp.LedgerTip.Slot, resp.LedgerTip.Hash) + log.Printf( + "Prepared response with LedgerTip: Slot=%v, Hash=%v", + resp.LedgerTip.Slot, + resp.LedgerTip.Hash, + ) log.Printf("Final response: %v", resp) return connect.NewResponse(resp), nil } @@ -195,7 +201,10 @@ func (s *queryServiceServer) SearchUtxos( var addr common.Address err := addr.UnmarshalCBOR(exactAddressBytes) if err != nil { - return nil, fmt.Errorf("failed to decode exact address: %w", err) + return nil, fmt.Errorf( + "failed to decode exact address: %w", + err, + ) } addresses = append(addresses, addr) } @@ -219,7 +228,10 @@ func (s *queryServiceServer) SearchUtxos( var delegationAddr common.Address err := delegationAddr.UnmarshalCBOR(delegationPart) if err != nil { - return nil, fmt.Errorf("failed to decode delegation part: %w", err) + return nil, fmt.Errorf( + "failed to decode delegation part: %w", + err, + ) } addresses = append(addresses, delegationAddr) } diff --git a/internal/utxorpc/submit.go b/internal/utxorpc/submit.go index 1eea260..1c24cfd 100644 --- a/internal/utxorpc/submit.go +++ b/internal/utxorpc/submit.go @@ -116,11 +116,20 @@ func (s *submitServiceServer) WaitForTx( // Log the transaction references at debug level for i, r := range ref { - logger.Debug("Transaction reference", "index", i, "ref", hex.EncodeToString(r)) + logger.Debug( + "Transaction reference", + "index", + i, + "ref", + hex.EncodeToString(r), + ) } // Setup event channel - eventChan := make(chan event.Event, 100) // Increased buffer size for high-throughput + eventChan := make( + chan event.Event, + 100, + ) // Increased buffer size for high-throughput connCfg := node.ConnectionConfig{ ChainSyncEventChan: eventChan, } diff --git a/openapi/api_default.go b/openapi/api_default.go index 53270a3..fa14638 100644 --- a/openapi/api_default.go +++ b/openapi/api_default.go @@ -34,7 +34,7 @@ type DefaultAPI interface { ) DefaultAPILocaltxsubmissionTxPostRequest // LocaltxsubmissionTxPostExecute executes the request - // @return string + // @return string LocaltxsubmissionTxPostExecute( r DefaultAPILocaltxsubmissionTxPostRequest, ) (string, *http.Response, error) @@ -80,7 +80,7 @@ func (a *DefaultAPIService) LocaltxsubmissionTxPost( // Execute executes the request // -// @return string +// @return string func (a *DefaultAPIService) LocaltxsubmissionTxPostExecute( r DefaultAPILocaltxsubmissionTxPostRequest, ) (string, *http.Response, error) { diff --git a/openapi/api_localstatequery.go b/openapi/api_localstatequery.go index e63957e..4435cb7 100644 --- a/openapi/api_localstatequery.go +++ b/openapi/api_localstatequery.go @@ -32,7 +32,7 @@ type LocalstatequeryAPI interface { ) LocalstatequeryAPILocalstatequeryCurrentEraGetRequest // LocalstatequeryCurrentEraGetExecute executes the request - // @return ApiResponseLocalStateQueryCurrentEra + // @return ApiResponseLocalStateQueryCurrentEra LocalstatequeryCurrentEraGetExecute( r LocalstatequeryAPILocalstatequeryCurrentEraGetRequest, ) (*ApiResponseLocalStateQueryCurrentEra, *http.Response, error) @@ -48,7 +48,7 @@ type LocalstatequeryAPI interface { ) LocalstatequeryAPILocalstatequeryEraHistoryGetRequest // LocalstatequeryEraHistoryGetExecute executes the request - // @return map[string]interface{} + // @return map[string]interface{} LocalstatequeryEraHistoryGetExecute( r LocalstatequeryAPILocalstatequeryEraHistoryGetRequest, ) (map[string]interface{}, *http.Response, error) @@ -64,7 +64,7 @@ type LocalstatequeryAPI interface { ) LocalstatequeryAPILocalstatequeryGenesisConfigGetRequest // LocalstatequeryGenesisConfigGetExecute executes the request - // @return map[string]interface{} + // @return map[string]interface{} LocalstatequeryGenesisConfigGetExecute( r LocalstatequeryAPILocalstatequeryGenesisConfigGetRequest, ) (map[string]interface{}, *http.Response, error) @@ -80,7 +80,7 @@ type LocalstatequeryAPI interface { ) LocalstatequeryAPILocalstatequeryProtocolParamsGetRequest // LocalstatequeryProtocolParamsGetExecute executes the request - // @return map[string]interface{} + // @return map[string]interface{} LocalstatequeryProtocolParamsGetExecute( r LocalstatequeryAPILocalstatequeryProtocolParamsGetRequest, ) (map[string]interface{}, *http.Response, error) @@ -96,7 +96,7 @@ type LocalstatequeryAPI interface { ) LocalstatequeryAPILocalstatequerySystemStartGetRequest // LocalstatequerySystemStartGetExecute executes the request - // @return ApiResponseLocalStateQuerySystemStart + // @return ApiResponseLocalStateQuerySystemStart LocalstatequerySystemStartGetExecute( r LocalstatequeryAPILocalstatequerySystemStartGetRequest, ) (*ApiResponseLocalStateQuerySystemStart, *http.Response, error) @@ -112,7 +112,7 @@ type LocalstatequeryAPI interface { ) LocalstatequeryAPILocalstatequeryTipGetRequest // LocalstatequeryTipGetExecute executes the request - // @return ApiResponseLocalStateQueryTip + // @return ApiResponseLocalStateQueryTip LocalstatequeryTipGetExecute( r LocalstatequeryAPILocalstatequeryTipGetRequest, ) (*ApiResponseLocalStateQueryTip, *http.Response, error) @@ -147,7 +147,7 @@ func (a *LocalstatequeryAPIService) LocalstatequeryCurrentEraGet( // Execute executes the request // -// @return ApiResponseLocalStateQueryCurrentEra +// @return ApiResponseLocalStateQueryCurrentEra func (a *LocalstatequeryAPIService) LocalstatequeryCurrentEraGetExecute( r LocalstatequeryAPILocalstatequeryCurrentEraGetRequest, ) (*ApiResponseLocalStateQueryCurrentEra, *http.Response, error) { @@ -281,7 +281,7 @@ func (a *LocalstatequeryAPIService) LocalstatequeryEraHistoryGet( // Execute executes the request // -// @return map[string]interface{} +// @return map[string]interface{} func (a *LocalstatequeryAPIService) LocalstatequeryEraHistoryGetExecute( r LocalstatequeryAPILocalstatequeryEraHistoryGetRequest, ) (map[string]interface{}, *http.Response, error) { @@ -415,7 +415,7 @@ func (a *LocalstatequeryAPIService) LocalstatequeryGenesisConfigGet( // Execute executes the request // -// @return map[string]interface{} +// @return map[string]interface{} func (a *LocalstatequeryAPIService) LocalstatequeryGenesisConfigGetExecute( r LocalstatequeryAPILocalstatequeryGenesisConfigGetRequest, ) (map[string]interface{}, *http.Response, error) { @@ -549,7 +549,7 @@ func (a *LocalstatequeryAPIService) LocalstatequeryProtocolParamsGet( // Execute executes the request // -// @return map[string]interface{} +// @return map[string]interface{} func (a *LocalstatequeryAPIService) LocalstatequeryProtocolParamsGetExecute( r LocalstatequeryAPILocalstatequeryProtocolParamsGetRequest, ) (map[string]interface{}, *http.Response, error) { @@ -683,7 +683,7 @@ func (a *LocalstatequeryAPIService) LocalstatequerySystemStartGet( // Execute executes the request // -// @return ApiResponseLocalStateQuerySystemStart +// @return ApiResponseLocalStateQuerySystemStart func (a *LocalstatequeryAPIService) LocalstatequerySystemStartGetExecute( r LocalstatequeryAPILocalstatequerySystemStartGetRequest, ) (*ApiResponseLocalStateQuerySystemStart, *http.Response, error) { @@ -817,7 +817,7 @@ func (a *LocalstatequeryAPIService) LocalstatequeryTipGet( // Execute executes the request // -// @return ApiResponseLocalStateQueryTip +// @return ApiResponseLocalStateQueryTip func (a *LocalstatequeryAPIService) LocalstatequeryTipGetExecute( r LocalstatequeryAPILocalstatequeryTipGetRequest, ) (*ApiResponseLocalStateQueryTip, *http.Response, error) { diff --git a/openapi/api_localtxmonitor.go b/openapi/api_localtxmonitor.go index 71dc9f7..b2dfd65 100644 --- a/openapi/api_localtxmonitor.go +++ b/openapi/api_localtxmonitor.go @@ -35,7 +35,7 @@ type LocaltxmonitorAPI interface { ) LocaltxmonitorAPILocaltxmonitorHasTxTxHashGetRequest // LocaltxmonitorHasTxTxHashGetExecute executes the request - // @return ApiResponseLocalTxMonitorHasTx + // @return ApiResponseLocalTxMonitorHasTx LocaltxmonitorHasTxTxHashGetExecute( r LocaltxmonitorAPILocaltxmonitorHasTxTxHashGetRequest, ) (*ApiResponseLocalTxMonitorHasTx, *http.Response, error) @@ -51,7 +51,7 @@ type LocaltxmonitorAPI interface { ) LocaltxmonitorAPILocaltxmonitorSizesGetRequest // LocaltxmonitorSizesGetExecute executes the request - // @return ApiResponseLocalTxMonitorSizes + // @return ApiResponseLocalTxMonitorSizes LocaltxmonitorSizesGetExecute( r LocaltxmonitorAPILocaltxmonitorSizesGetRequest, ) (*ApiResponseLocalTxMonitorSizes, *http.Response, error) @@ -67,7 +67,7 @@ type LocaltxmonitorAPI interface { ) LocaltxmonitorAPILocaltxmonitorTxsGetRequest // LocaltxmonitorTxsGetExecute executes the request - // @return []ApiResponseLocalTxMonitorTxs + // @return []ApiResponseLocalTxMonitorTxs LocaltxmonitorTxsGetExecute( r LocaltxmonitorAPILocaltxmonitorTxsGetRequest, ) ([]ApiResponseLocalTxMonitorTxs, *http.Response, error) @@ -106,7 +106,7 @@ func (a *LocaltxmonitorAPIService) LocaltxmonitorHasTxTxHashGet( // Execute executes the request // -// @return ApiResponseLocalTxMonitorHasTx +// @return ApiResponseLocalTxMonitorHasTx func (a *LocaltxmonitorAPIService) LocaltxmonitorHasTxTxHashGetExecute( r LocaltxmonitorAPILocaltxmonitorHasTxTxHashGetRequest, ) (*ApiResponseLocalTxMonitorHasTx, *http.Response, error) { @@ -246,7 +246,7 @@ func (a *LocaltxmonitorAPIService) LocaltxmonitorSizesGet( // Execute executes the request // -// @return ApiResponseLocalTxMonitorSizes +// @return ApiResponseLocalTxMonitorSizes func (a *LocaltxmonitorAPIService) LocaltxmonitorSizesGetExecute( r LocaltxmonitorAPILocaltxmonitorSizesGetRequest, ) (*ApiResponseLocalTxMonitorSizes, *http.Response, error) { @@ -380,7 +380,7 @@ func (a *LocaltxmonitorAPIService) LocaltxmonitorTxsGet( // Execute executes the request // -// @return []ApiResponseLocalTxMonitorTxs +// @return []ApiResponseLocalTxMonitorTxs func (a *LocaltxmonitorAPIService) LocaltxmonitorTxsGetExecute( r LocaltxmonitorAPILocaltxmonitorTxsGetRequest, ) ([]ApiResponseLocalTxMonitorTxs, *http.Response, error) { diff --git a/openapi/api_localtxsubmission.go b/openapi/api_localtxsubmission.go index 4a9b8b3..8127678 100644 --- a/openapi/api_localtxsubmission.go +++ b/openapi/api_localtxsubmission.go @@ -34,7 +34,7 @@ type LocaltxsubmissionAPI interface { ) LocaltxsubmissionAPILocaltxsubmissionTxPostRequest // LocaltxsubmissionTxPostExecute executes the request - // @return string + // @return string LocaltxsubmissionTxPostExecute( r LocaltxsubmissionAPILocaltxsubmissionTxPostRequest, ) (string, *http.Response, error) @@ -80,7 +80,7 @@ func (a *LocaltxsubmissionAPIService) LocaltxsubmissionTxPost( // Execute executes the request // -// @return string +// @return string func (a *LocaltxsubmissionAPIService) LocaltxsubmissionTxPostExecute( r LocaltxsubmissionAPILocaltxsubmissionTxPostRequest, ) (string, *http.Response, error) {