File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -66,10 +66,10 @@ func (g *AlonzoGenesis) NormalizeCostModels() error {
66
66
}
67
67
68
68
func (c * CostModel ) UnmarshalJSON (data []byte ) error {
69
- tmpMap := make (map [string ]interface {} )
69
+ tmpMap := make (map [string ]any )
70
70
if err := json .Unmarshal (data , & tmpMap ); err != nil {
71
71
// Try to unmarshal as array first
72
- var tmpArray []interface {}
72
+ var tmpArray []any
73
73
if arrayErr := json .Unmarshal (data , & tmpArray ); arrayErr == nil {
74
74
* c = make (CostModel )
75
75
for i , v := range tmpArray {
@@ -95,7 +95,7 @@ func (c *CostModel) UnmarshalJSON(data []byte) error {
95
95
return nil
96
96
}
97
97
98
- func toInt (v interface {} ) (int , error ) {
98
+ func toInt (v any ) (int , error ) {
99
99
switch val := v .(type ) {
100
100
case float64 :
101
101
if val > float64 (math .MaxInt ) || val < float64 (math .MinInt ) {
Original file line number Diff line number Diff line change @@ -224,7 +224,7 @@ func TestCostModelArrayFormat(t *testing.T) {
224
224
}
225
225
226
226
func TestScientificNotationInCostModels (t * testing.T ) {
227
- costModel := map [string ]interface {} {
227
+ costModel := map [string ]any {
228
228
"0" : 2.477736e+06 , // Changed from param1 to 0
229
229
"1" : 1.5e6 , // Changed from param2 to 1
230
230
"2" : 1000000 , // Changed from param3 to 2
@@ -442,7 +442,7 @@ func TestAlonzoUtxorpc(t *testing.T) {
442
442
}
443
443
}
444
444
445
- func toJSON (v interface {} ) string {
445
+ func toJSON (v any ) string {
446
446
b , err := json .Marshal (v )
447
447
if err != nil {
448
448
panic (fmt .Sprintf ("failed to marshal JSON: %v" , err ))
You can’t perform that action at this time.
0 commit comments