Skip to content

Commit 33cbb99

Browse files
authored
chore: make format golines (#872)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 43f73f8 commit 33cbb99

File tree

5 files changed

+34
-11
lines changed

5 files changed

+34
-11
lines changed

ledger/eras/conway.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,9 @@ func EvaluateTxConway(
238238
// Lookup script from redeemer purpose
239239
tmpScript := scripts[purpose.ScriptHash()]
240240
if tmpScript == nil {
241-
return 0, lcommon.ExUnits{}, nil, errors.New("could not find needed script")
241+
return 0, lcommon.ExUnits{}, nil, errors.New(
242+
"could not find needed script",
243+
)
242244
}
243245
switch s := tmpScript.(type) {
244246
case *lcommon.PlutusV3Script:

ledger/state.go

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -597,12 +597,17 @@ func (ls *LedgerState) ledgerProcessBlocks() {
597597
// Get parameters from Shelley Genesis
598598
shelleyGenesis := ls.config.CardanoNodeConfig.ShelleyGenesis()
599599
if shelleyGenesis == nil {
600-
return errors.New("failed to get Shelley Genesis config")
600+
return errors.New(
601+
"failed to get Shelley Genesis config",
602+
)
601603
}
602604
// Get security parameter (k)
603605
k := shelleyGenesis.SecurityParam
604606
if k < 0 {
605-
return fmt.Errorf("security param must be non-negative: %d", k)
607+
return fmt.Errorf(
608+
"security param must be non-negative: %d",
609+
k,
610+
)
606611
}
607612
securityParam := uint64(k)
608613
currentTipSlot := ls.currentTip.Point.Slot
@@ -618,10 +623,14 @@ func (ls *LedgerState) ledgerProcessBlocks() {
618623
shouldValidate = true
619624
ls.config.Logger.Debug(
620625
"enabling validation as block within k-slot window",
621-
"security_param", securityParam,
622-
"currentTipSlot", currentTipSlot,
623-
"cutoffSlot", cutoffSlot,
624-
"blockSlot", blockSlot,
626+
"security_param",
627+
securityParam,
628+
"currentTipSlot",
629+
currentTipSlot,
630+
"cutoffSlot",
631+
cutoffSlot,
632+
"blockSlot",
633+
blockSlot,
625634
)
626635
} else {
627636
shouldValidate = false
@@ -1049,7 +1058,11 @@ func (ls *LedgerState) EvaluateTx(
10491058
return err
10501059
})
10511060
if err != nil {
1052-
return 0, lcommon.ExUnits{}, nil, fmt.Errorf("TX %s failed evaluation: %w", tx.Hash(), err)
1061+
return 0, lcommon.ExUnits{}, nil, fmt.Errorf(
1062+
"TX %s failed evaluation: %w",
1063+
tx.Hash(),
1064+
err,
1065+
)
10531066
}
10541067
}
10551068
return fee, totalExUnits, redeemerExUnits, nil

utxorpc/submit.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ func (s *submitServiceServer) EvalTx(
197197
return nil, fmt.Errorf("failed to parse transaction CBOR: %w", err)
198198
}
199199
// Evaluate TX
200-
fee, totalExUnits, redeemerExUnits, err := s.utxorpc.config.LedgerState.EvaluateTx(tx)
200+
fee, totalExUnits, redeemerExUnits, err := s.utxorpc.config.LedgerState.EvaluateTx(
201+
tx,
202+
)
201203
// Populate response
202204
tmpRedeemers := make([]*cardano.Redeemer, 0, len(redeemerExUnits))
203205
for key, val := range redeemerExUnits {

utxorpc/sync.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,10 @@ func (s *syncServiceServer) FollowTip(
230230
}
231231
if next != nil {
232232
// Send block response
233-
block, err := ledger.NewBlockFromCbor(next.Block.Type, next.Block.Cbor)
233+
block, err := ledger.NewBlockFromCbor(
234+
next.Block.Type,
235+
next.Block.Cbor,
236+
)
234237
if err != nil {
235238
s.utxorpc.config.Logger.Error(
236239
"failed to get block",

utxorpc/watch.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ func (s *watchServiceServer) WatchTx(
109109
}
110110
if next != nil {
111111
// Get ledger.Block from bytes
112-
block, err := ledger.NewBlockFromCbor(next.Block.Type, next.Block.Cbor)
112+
block, err := ledger.NewBlockFromCbor(
113+
next.Block.Type,
114+
next.Block.Cbor,
115+
)
113116
if err != nil {
114117
s.utxorpc.config.Logger.Error(
115118
"failed to get block",

0 commit comments

Comments
 (0)