Skip to content

Commit 98ac789

Browse files
authored
chore: make golines (#764)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent df7a866 commit 98ac789

File tree

14 files changed

+944
-91
lines changed

14 files changed

+944
-91
lines changed

ledger/allegra/pparams.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ type AllegraProtocolParameters struct {
2323
shelley.ShelleyProtocolParameters
2424
}
2525

26-
func (p *AllegraProtocolParameters) Update(paramUpdate *AllegraProtocolParameterUpdate) {
26+
func (p *AllegraProtocolParameters) Update(
27+
paramUpdate *AllegraProtocolParameterUpdate,
28+
) {
2729
p.ShelleyProtocolParameters.Update(
2830
&paramUpdate.ShelleyProtocolParameterUpdate,
2931
)

ledger/allegra/pparams_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ func TestAllegraProtocolParamsUpdate(t *testing.T) {
7070
tmpParams := testDef.startParams
7171
tmpParams.Update(&tmpUpdate)
7272
if !reflect.DeepEqual(tmpParams, testDef.expectedParams) {
73-
t.Fatalf("did not get expected params:\n got: %#v\n wanted: %#v", tmpParams, testDef.expectedParams)
73+
t.Fatalf(
74+
"did not get expected params:\n got: %#v\n wanted: %#v",
75+
tmpParams,
76+
testDef.expectedParams,
77+
)
7478
}
7579
}
7680
}

ledger/alonzo/pparams.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ type AlonzoProtocolParameters struct {
3434
MaxCollateralInputs uint
3535
}
3636

37-
func (p *AlonzoProtocolParameters) Update(paramUpdate *AlonzoProtocolParameterUpdate) {
37+
func (p *AlonzoProtocolParameters) Update(
38+
paramUpdate *AlonzoProtocolParameterUpdate,
39+
) {
3840
p.MaryProtocolParameters.Update(
3941
&paramUpdate.MaryProtocolParameterUpdate,
4042
)
@@ -81,7 +83,8 @@ func (p *AlonzoProtocolParameters) UpdateFromGenesis(genesis *AlonzoGenesis) {
8183
Mem: genesis.MaxBlockExUnits.Mem,
8284
Steps: genesis.MaxBlockExUnits.Steps,
8385
}
84-
if genesis.ExecutionPrices.Mem != nil && genesis.ExecutionPrices.Steps != nil {
86+
if genesis.ExecutionPrices.Mem != nil &&
87+
genesis.ExecutionPrices.Steps != nil {
8588
p.ExecutionCosts = common.ExUnitPrice{
8689
MemPrice: &cbor.Rat{Rat: genesis.ExecutionPrices.Mem.Rat},
8790
StepPrice: &cbor.Rat{Rat: genesis.ExecutionPrices.Steps.Rat},

ledger/alonzo/pparams_test.go

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ func TestAlonzoProtocolParamsUpdate(t *testing.T) {
4040
MaryProtocolParameters: mary.MaryProtocolParameters{
4141
AllegraProtocolParameters: allegra.AllegraProtocolParameters{
4242
ShelleyProtocolParameters: shelley.ShelleyProtocolParameters{
43-
Decentralization: &cbor.Rat{Rat: new(big.Rat).SetInt64(1)},
43+
Decentralization: &cbor.Rat{
44+
Rat: new(big.Rat).SetInt64(1),
45+
},
4446
},
4547
},
4648
},
@@ -119,7 +121,11 @@ func TestAlonzoProtocolParamsUpdate(t *testing.T) {
119121
tmpParams := testDef.startParams
120122
tmpParams.Update(&tmpUpdate)
121123
if !reflect.DeepEqual(tmpParams, testDef.expectedParams) {
122-
t.Fatalf("did not get expected params:\n got: %#v\n wanted: %#v", tmpParams, testDef.expectedParams)
124+
t.Fatalf(
125+
"did not get expected params:\n got: %#v\n wanted: %#v",
126+
tmpParams,
127+
testDef.expectedParams,
128+
)
123129
}
124130
}
125131
}
@@ -135,7 +141,9 @@ func TestAlonzoProtocolParamsUpdateFromGenesis(t *testing.T) {
135141
MaryProtocolParameters: mary.MaryProtocolParameters{
136142
AllegraProtocolParameters: allegra.AllegraProtocolParameters{
137143
ShelleyProtocolParameters: shelley.ShelleyProtocolParameters{
138-
Decentralization: &cbor.Rat{Rat: new(big.Rat).SetInt64(1)},
144+
Decentralization: &cbor.Rat{
145+
Rat: new(big.Rat).SetInt64(1),
146+
},
139147
},
140148
},
141149
},
@@ -145,7 +153,9 @@ func TestAlonzoProtocolParamsUpdateFromGenesis(t *testing.T) {
145153
MaryProtocolParameters: mary.MaryProtocolParameters{
146154
AllegraProtocolParameters: allegra.AllegraProtocolParameters{
147155
ShelleyProtocolParameters: shelley.ShelleyProtocolParameters{
148-
Decentralization: &cbor.Rat{Rat: new(big.Rat).SetInt64(1)},
156+
Decentralization: &cbor.Rat{
157+
Rat: new(big.Rat).SetInt64(1),
158+
},
149159
},
150160
},
151161
},
@@ -154,14 +164,20 @@ func TestAlonzoProtocolParamsUpdateFromGenesis(t *testing.T) {
154164
},
155165
}
156166
for _, testDef := range testDefs {
157-
tmpGenesis, err := alonzo.NewAlonzoGenesisFromReader(strings.NewReader(testDef.genesisJson))
167+
tmpGenesis, err := alonzo.NewAlonzoGenesisFromReader(
168+
strings.NewReader(testDef.genesisJson),
169+
)
158170
if err != nil {
159171
t.Fatalf("unexpected error: %s", err)
160172
}
161173
tmpParams := testDef.startParams
162174
tmpParams.UpdateFromGenesis(&tmpGenesis)
163175
if !reflect.DeepEqual(tmpParams, testDef.expectedParams) {
164-
t.Fatalf("did not get expected params:\n got: %#v\n wanted: %#v", tmpParams, testDef.expectedParams)
176+
t.Fatalf(
177+
"did not get expected params:\n got: %#v\n wanted: %#v",
178+
tmpParams,
179+
testDef.expectedParams,
180+
)
165181
}
166182
}
167183
}

ledger/babbage/pparams.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ type BabbageProtocolParameters struct {
4848
MaxCollateralInputs uint
4949
}
5050

51-
func (p *BabbageProtocolParameters) Update(paramUpdate *BabbageProtocolParameterUpdate) {
51+
func (p *BabbageProtocolParameters) Update(
52+
paramUpdate *BabbageProtocolParameterUpdate,
53+
) {
5254
if paramUpdate.MinFeeA != nil {
5355
p.MinFeeA = *paramUpdate.MinFeeA
5456
}

0 commit comments

Comments
 (0)