Skip to content

Commit d0f5e36

Browse files
authored
chore: make format golines (#976)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 5055748 commit d0f5e36

File tree

7 files changed

+153
-26
lines changed

7 files changed

+153
-26
lines changed

ledger/allegra/allegra.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,10 @@ func (t AllegraTransaction) Produced() []common.Utxo {
278278
ret = append(
279279
ret,
280280
common.Utxo{
281-
Id: shelley.NewShelleyTransactionInput(t.Hash().String(), idx),
281+
Id: shelley.NewShelleyTransactionInput(
282+
t.Hash().String(),
283+
idx,
284+
),
282285
Output: output,
283286
},
284287
)

ledger/alonzo/alonzo.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,10 @@ func (t AlonzoTransaction) Produced() []common.Utxo {
475475
ret = append(
476476
ret,
477477
common.Utxo{
478-
Id: shelley.NewShelleyTransactionInput(t.Hash().String(), idx),
478+
Id: shelley.NewShelleyTransactionInput(
479+
t.Hash().String(),
480+
idx,
481+
),
479482
Output: output,
480483
},
481484
)

ledger/babbage/babbage.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,10 @@ func (t BabbageTransaction) Produced() []common.Utxo {
624624
ret = append(
625625
ret,
626626
common.Utxo{
627-
Id: shelley.NewShelleyTransactionInput(t.Hash().String(), idx),
627+
Id: shelley.NewShelleyTransactionInput(
628+
t.Hash().String(),
629+
idx,
630+
),
628631
Output: output,
629632
},
630633
)

ledger/common/common_test.go

Lines changed: 129 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -250,32 +250,141 @@ func TestCertificateTypeMethods(t *testing.T) {
250250
cert Certificate
251251
expected uint
252252
}{
253-
{"StakeRegistration", &StakeRegistrationCertificate{CertType: CertificateTypeStakeRegistration}, CertificateTypeStakeRegistration},
254-
{"StakeDeregistration", &StakeDeregistrationCertificate{CertType: CertificateTypeStakeDeregistration}, CertificateTypeStakeDeregistration},
255-
{"StakeDelegation", &StakeDelegationCertificate{CertType: CertificateTypeStakeDelegation}, CertificateTypeStakeDelegation},
256-
{"PoolRegistration", &PoolRegistrationCertificate{CertType: CertificateTypePoolRegistration}, CertificateTypePoolRegistration},
257-
{"PoolRetirement", &PoolRetirementCertificate{CertType: CertificateTypePoolRetirement}, CertificateTypePoolRetirement},
258-
{"GenesisKeyDelegation", &GenesisKeyDelegationCertificate{CertType: CertificateTypeGenesisKeyDelegation}, CertificateTypeGenesisKeyDelegation},
259-
{"MoveInstantaneousRewards", &MoveInstantaneousRewardsCertificate{CertType: CertificateTypeMoveInstantaneousRewards}, CertificateTypeMoveInstantaneousRewards},
260-
{"Registration", &RegistrationCertificate{CertType: CertificateTypeRegistration}, CertificateTypeRegistration},
261-
{"Deregistration", &DeregistrationCertificate{CertType: CertificateTypeDeregistration}, CertificateTypeDeregistration},
262-
{"VoteDelegation", &VoteDelegationCertificate{CertType: CertificateTypeVoteDelegation}, CertificateTypeVoteDelegation},
263-
{"StakeVoteDelegation", &StakeVoteDelegationCertificate{CertType: CertificateTypeStakeVoteDelegation}, CertificateTypeStakeVoteDelegation},
264-
{"StakeRegistrationDelegation", &StakeRegistrationDelegationCertificate{CertType: CertificateTypeStakeRegistrationDelegation}, CertificateTypeStakeRegistrationDelegation},
265-
{"VoteRegistrationDelegation", &VoteRegistrationDelegationCertificate{CertType: CertificateTypeVoteRegistrationDelegation}, CertificateTypeVoteRegistrationDelegation},
266-
{"StakeVoteRegistrationDelegation", &StakeVoteRegistrationDelegationCertificate{CertType: CertificateTypeStakeVoteRegistrationDelegation}, CertificateTypeStakeVoteRegistrationDelegation},
267-
{"AuthCommitteeHot", &AuthCommitteeHotCertificate{CertType: CertificateTypeAuthCommitteeHot}, CertificateTypeAuthCommitteeHot},
268-
{"ResignCommitteeCold", &ResignCommitteeColdCertificate{CertType: CertificateTypeResignCommitteeCold}, CertificateTypeResignCommitteeCold},
269-
{"RegistrationDrep", &RegistrationDrepCertificate{CertType: CertificateTypeRegistrationDrep}, CertificateTypeRegistrationDrep},
270-
{"DeregistrationDrep", &DeregistrationDrepCertificate{CertType: CertificateTypeDeregistrationDrep}, CertificateTypeDeregistrationDrep},
271-
{"UpdateDrep", &UpdateDrepCertificate{CertType: CertificateTypeUpdateDrep}, CertificateTypeUpdateDrep},
253+
{
254+
"StakeRegistration",
255+
&StakeRegistrationCertificate{
256+
CertType: CertificateTypeStakeRegistration,
257+
},
258+
CertificateTypeStakeRegistration,
259+
},
260+
{
261+
"StakeDeregistration",
262+
&StakeDeregistrationCertificate{
263+
CertType: CertificateTypeStakeDeregistration,
264+
},
265+
CertificateTypeStakeDeregistration,
266+
},
267+
{
268+
"StakeDelegation",
269+
&StakeDelegationCertificate{
270+
CertType: CertificateTypeStakeDelegation,
271+
},
272+
CertificateTypeStakeDelegation,
273+
},
274+
{
275+
"PoolRegistration",
276+
&PoolRegistrationCertificate{
277+
CertType: CertificateTypePoolRegistration,
278+
},
279+
CertificateTypePoolRegistration,
280+
},
281+
{
282+
"PoolRetirement",
283+
&PoolRetirementCertificate{CertType: CertificateTypePoolRetirement},
284+
CertificateTypePoolRetirement,
285+
},
286+
{
287+
"GenesisKeyDelegation",
288+
&GenesisKeyDelegationCertificate{
289+
CertType: CertificateTypeGenesisKeyDelegation,
290+
},
291+
CertificateTypeGenesisKeyDelegation,
292+
},
293+
{
294+
"MoveInstantaneousRewards",
295+
&MoveInstantaneousRewardsCertificate{
296+
CertType: CertificateTypeMoveInstantaneousRewards,
297+
},
298+
CertificateTypeMoveInstantaneousRewards,
299+
},
300+
{
301+
"Registration",
302+
&RegistrationCertificate{CertType: CertificateTypeRegistration},
303+
CertificateTypeRegistration,
304+
},
305+
{
306+
"Deregistration",
307+
&DeregistrationCertificate{CertType: CertificateTypeDeregistration},
308+
CertificateTypeDeregistration,
309+
},
310+
{
311+
"VoteDelegation",
312+
&VoteDelegationCertificate{CertType: CertificateTypeVoteDelegation},
313+
CertificateTypeVoteDelegation,
314+
},
315+
{
316+
"StakeVoteDelegation",
317+
&StakeVoteDelegationCertificate{
318+
CertType: CertificateTypeStakeVoteDelegation,
319+
},
320+
CertificateTypeStakeVoteDelegation,
321+
},
322+
{
323+
"StakeRegistrationDelegation",
324+
&StakeRegistrationDelegationCertificate{
325+
CertType: CertificateTypeStakeRegistrationDelegation,
326+
},
327+
CertificateTypeStakeRegistrationDelegation,
328+
},
329+
{
330+
"VoteRegistrationDelegation",
331+
&VoteRegistrationDelegationCertificate{
332+
CertType: CertificateTypeVoteRegistrationDelegation,
333+
},
334+
CertificateTypeVoteRegistrationDelegation,
335+
},
336+
{
337+
"StakeVoteRegistrationDelegation",
338+
&StakeVoteRegistrationDelegationCertificate{
339+
CertType: CertificateTypeStakeVoteRegistrationDelegation,
340+
},
341+
CertificateTypeStakeVoteRegistrationDelegation,
342+
},
343+
{
344+
"AuthCommitteeHot",
345+
&AuthCommitteeHotCertificate{
346+
CertType: CertificateTypeAuthCommitteeHot,
347+
},
348+
CertificateTypeAuthCommitteeHot,
349+
},
350+
{
351+
"ResignCommitteeCold",
352+
&ResignCommitteeColdCertificate{
353+
CertType: CertificateTypeResignCommitteeCold,
354+
},
355+
CertificateTypeResignCommitteeCold,
356+
},
357+
{
358+
"RegistrationDrep",
359+
&RegistrationDrepCertificate{
360+
CertType: CertificateTypeRegistrationDrep,
361+
},
362+
CertificateTypeRegistrationDrep,
363+
},
364+
{
365+
"DeregistrationDrep",
366+
&DeregistrationDrepCertificate{
367+
CertType: CertificateTypeDeregistrationDrep,
368+
},
369+
CertificateTypeDeregistrationDrep,
370+
},
371+
{
372+
"UpdateDrep",
373+
&UpdateDrepCertificate{CertType: CertificateTypeUpdateDrep},
374+
CertificateTypeUpdateDrep,
375+
},
272376
}
273377

274378
for _, tt := range tests {
275379
t.Run(tt.name, func(t *testing.T) {
276380
got := tt.cert.Type()
277381
if got != tt.expected {
278-
t.Errorf("FAIL: %s -> Type() = %d, expected = %d", tt.name, got, tt.expected)
382+
t.Errorf(
383+
"FAIL: %s -> Type() = %d, expected = %d",
384+
tt.name,
385+
got,
386+
tt.expected,
387+
)
279388
} else {
280389
t.Logf("PASS: %s -> Type() = %d, expected = %d \n", tt.name, got, tt.expected)
281390
}

ledger/conway/conway.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,10 @@ func (t ConwayTransaction) Produced() []common.Utxo {
430430
ret = append(
431431
ret,
432432
common.Utxo{
433-
Id: shelley.NewShelleyTransactionInput(t.Hash().String(), idx),
433+
Id: shelley.NewShelleyTransactionInput(
434+
t.Hash().String(),
435+
idx,
436+
),
434437
Output: output,
435438
},
436439
)

ledger/mary/mary.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,10 @@ func (t MaryTransaction) Produced() []common.Utxo {
289289
ret = append(
290290
ret,
291291
common.Utxo{
292-
Id: shelley.NewShelleyTransactionInput(t.Hash().String(), idx),
292+
Id: shelley.NewShelleyTransactionInput(
293+
t.Hash().String(),
294+
idx,
295+
),
293296
Output: output,
294297
},
295298
)

protocol/chainsync/client.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,10 @@ func (c *Client) handleRollForward(msgGeneric protocol.Message) error {
652652
firstBlockChan <- clientPointResult{error: err}
653653
return err
654654
}
655-
point := common.NewPoint(blockHeader.SlotNumber(), blockHeader.Hash().Bytes())
655+
point := common.NewPoint(
656+
blockHeader.SlotNumber(),
657+
blockHeader.Hash().Bytes(),
658+
)
656659
firstBlockChan <- clientPointResult{tip: msg.Tip, point: point}
657660
return nil
658661
}

0 commit comments

Comments
 (0)