Skip to content

Commit 56dd2aa

Browse files
committed
chore: make golines
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 80906aa commit 56dd2aa

File tree

13 files changed

+838
-53
lines changed

13 files changed

+838
-53
lines changed

ledger/allegra/pparams.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ type AllegraProtocolParameters struct {
2020
shelley.ShelleyProtocolParameters
2121
}
2222

23-
func (p *AllegraProtocolParameters) Update(paramUpdate *AllegraProtocolParameterUpdate) {
23+
func (p *AllegraProtocolParameters) Update(
24+
paramUpdate *AllegraProtocolParameterUpdate,
25+
) {
2426
p.ShelleyProtocolParameters.Update(
2527
&paramUpdate.ShelleyProtocolParameterUpdate,
2628
)

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: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ type AlonzoProtocolParameters struct {
3333
MaxCollateralInputs uint
3434
}
3535

36-
func (p *AlonzoProtocolParameters) Update(paramUpdate *AlonzoProtocolParameterUpdate) {
36+
func (p *AlonzoProtocolParameters) Update(
37+
paramUpdate *AlonzoProtocolParameterUpdate,
38+
) {
3739
p.MaryProtocolParameters.Update(
3840
&paramUpdate.MaryProtocolParameterUpdate,
3941
)
@@ -80,7 +82,8 @@ func (p *AlonzoProtocolParameters) UpdateFromGenesis(genesis *AlonzoGenesis) {
8082
Mem: genesis.MaxBlockExUnits.Mem,
8183
Steps: genesis.MaxBlockExUnits.Steps,
8284
}
83-
if genesis.ExecutionPrices.Mem != nil && genesis.ExecutionPrices.Steps != nil {
85+
if genesis.ExecutionPrices.Mem != nil &&
86+
genesis.ExecutionPrices.Steps != nil {
8487
p.ExecutionCosts = common.ExUnitPrice{
8588
MemPrice: &cbor.Rat{Rat: genesis.ExecutionPrices.Mem.Rat},
8689
StepPrice: &cbor.Rat{Rat: genesis.ExecutionPrices.Steps.Rat},
@@ -95,7 +98,7 @@ type AlonzoProtocolParameterUpdate struct {
9598
mary.MaryProtocolParameterUpdate
9699
MinPoolCost *uint64 `cbor:"16,keyasint"`
97100
AdaPerUtxoByte *uint64 `cbor:"17,keyasint"`
98-
CostModels map[uint][]int64 `cbor:"18,keyasint"`
101+
CostModels map[uint][]int64 `cbor:"18,keyasint"`
99102
ExecutionCosts *common.ExUnitPrice `cbor:"19,keyasint"`
100103
MaxTxExUnits *common.ExUnit `cbor:"20,keyasint"`
101104
MaxBlockExUnits *common.ExUnit `cbor:"21,keyasint"`

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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ type BabbageProtocolParameters struct {
4747
MaxCollateralInputs uint
4848
}
4949

50-
func (p *BabbageProtocolParameters) Update(paramUpdate *BabbageProtocolParameterUpdate) {
50+
func (p *BabbageProtocolParameters) Update(
51+
paramUpdate *BabbageProtocolParameterUpdate,
52+
) {
5153
if paramUpdate.MinFeeA != nil {
5254
p.MinFeeA = *paramUpdate.MinFeeA
5355
}
@@ -134,7 +136,7 @@ type BabbageProtocolParameterUpdate struct {
134136
ProtocolVersion *common.ProtocolParametersProtocolVersion `cbor:"14,keyasint"`
135137
MinPoolCost *uint64 `cbor:"16,keyasint"`
136138
AdaPerUtxoByte *uint64 `cbor:"17,keyasint"`
137-
CostModels map[uint][]int64 `cbor:"18,keyasint"`
139+
CostModels map[uint][]int64 `cbor:"18,keyasint"`
138140
ExecutionCosts *common.ExUnitPrice `cbor:"19,keyasint"`
139141
MaxTxExUnits *common.ExUnit `cbor:"20,keyasint"`
140142
MaxBlockExUnits *common.ExUnit `cbor:"21,keyasint"`

0 commit comments

Comments
 (0)