File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -171,17 +171,23 @@ func (u *ShelleyProtocolParameterUpdate) UnmarshalCBOR(cborData []byte) error {
171171
172172func (p * ShelleyProtocolParameters ) Utxorpc () (* cardano.PParams , error ) {
173173 // sanity check
174- if p .A0 .Num ().Int64 () > math .MaxInt32 ||
174+ if p .A0 == nil ||
175+ p .A0 .Num ().Int64 () < math .MinInt32 ||
176+ p .A0 .Num ().Int64 () > math .MaxInt32 ||
175177 p .A0 .Denom ().Int64 () < 0 ||
176178 p .A0 .Denom ().Int64 () > math .MaxUint32 {
177179 return nil , errors .New ("invalid A0 rational number values" )
178180 }
179- if p .Rho .Num ().Int64 () > math .MaxInt32 ||
181+ if p .Rho == nil ||
182+ p .Rho .Num ().Int64 () < math .MinInt32 ||
183+ p .Rho .Num ().Int64 () > math .MaxInt32 ||
180184 p .Rho .Denom ().Int64 () < 0 ||
181185 p .Rho .Denom ().Int64 () > math .MaxUint32 {
182186 return nil , errors .New ("invalid Rho rational number values" )
183187 }
184- if p .Tau .Num ().Int64 () > math .MaxInt32 ||
188+ if p .Tau == nil ||
189+ p .Tau .Num ().Int64 () < math .MinInt32 ||
190+ p .Tau .Num ().Int64 () > math .MaxInt32 ||
185191 p .Tau .Denom ().Int64 () < 0 ||
186192 p .Tau .Denom ().Int64 () > math .MaxUint32 {
187193 return nil , errors .New ("invalid Tau rational number values" )
You can’t perform that action at this time.
0 commit comments