File tree Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -239,9 +239,9 @@ func (p *ConwayProtocolParameters) Update(
239
239
}
240
240
}
241
241
242
- func (p * ConwayProtocolParameters ) UpdateFromGenesis (genesis * ConwayGenesis ) {
242
+ func (p * ConwayProtocolParameters ) UpdateFromGenesis (genesis * ConwayGenesis ) error {
243
243
if genesis == nil {
244
- return
244
+ return nil
245
245
}
246
246
p .MinCommitteeSize = genesis .MinCommitteeSize
247
247
p .CommitteeTermLimit = genesis .CommitteeTermLimit
@@ -335,6 +335,7 @@ func (p *ConwayProtocolParameters) UpdateFromGenesis(genesis *ConwayGenesis) {
335
335
Rat : genesis .DRepVotingThresholds .TreasuryWithdrawal .Rat ,
336
336
}
337
337
}
338
+ return nil
338
339
}
339
340
340
341
type ConwayProtocolParameterUpdate struct {
Original file line number Diff line number Diff line change @@ -466,7 +466,9 @@ func TestConwayProtocolParamsUpdateFromGenesis(t *testing.T) {
466
466
t .Fatalf ("unexpected error: %s" , err )
467
467
}
468
468
tmpParams := testDef .startParams
469
- tmpParams .UpdateFromGenesis (& tmpGenesis )
469
+ if err := tmpParams .UpdateFromGenesis (& tmpGenesis ); err != nil {
470
+ t .Fatalf ("unexpected error updating pparams from genesis: %s" , err )
471
+ }
470
472
if ! reflect .DeepEqual (tmpParams , testDef .expectedParams ) {
471
473
t .Fatalf (
472
474
"did not get expected params:\n got: %#v\n wanted: %#v" ,
Original file line number Diff line number Diff line change @@ -98,9 +98,9 @@ func (p *ShelleyProtocolParameters) Update(
98
98
}
99
99
}
100
100
101
- func (p * ShelleyProtocolParameters ) UpdateFromGenesis (genesis * ShelleyGenesis ) {
101
+ func (p * ShelleyProtocolParameters ) UpdateFromGenesis (genesis * ShelleyGenesis ) error {
102
102
if genesis == nil {
103
- return
103
+ return nil
104
104
}
105
105
genesisParams := genesis .ProtocolParameters
106
106
p .MinFeeA = genesisParams .MinFeeA
@@ -130,6 +130,7 @@ func (p *ShelleyProtocolParameters) UpdateFromGenesis(genesis *ShelleyGenesis) {
130
130
p .ProtocolMajor = genesisParams .ProtocolVersion .Major
131
131
p .ProtocolMinor = genesisParams .ProtocolVersion .Minor
132
132
p .MinUtxoValue = genesisParams .MinUtxoValue
133
+ return nil
133
134
}
134
135
135
136
type ShelleyProtocolParameterUpdate struct {
Original file line number Diff line number Diff line change @@ -95,7 +95,9 @@ func TestShelleyProtocolParamsUpdateFromGenesis(t *testing.T) {
95
95
t .Fatalf ("unexpected error: %s" , err )
96
96
}
97
97
tmpParams := testDef .startParams
98
- tmpParams .UpdateFromGenesis (& tmpGenesis )
98
+ if err := tmpParams .UpdateFromGenesis (& tmpGenesis ); err != nil {
99
+ t .Fatalf ("unexpected error updating pparams from genesis: %s" , err )
100
+ }
99
101
if ! reflect .DeepEqual (tmpParams , testDef .expectedParams ) {
100
102
t .Fatalf (
101
103
"did not get expected params:\n got: %#v\n wanted: %#v" ,
You can’t perform that action at this time.
0 commit comments