File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,6 @@ import (
13
13
14
14
"golang.org/x/sys/unix"
15
15
16
- "github.com/vmihailenco/msgpack/v5"
17
-
18
16
"github.com/CosmWasm/wasmvm/v2/types"
19
17
)
20
18
@@ -200,7 +198,7 @@ func GetPinnedMetrics(cache Cache) (*types.PinnedMetrics, error) {
200
198
}
201
199
202
200
var pinnedMetrics types.PinnedMetrics
203
- if err := msgpack . Unmarshal (copyAndDestroyUnmanagedVector (metrics ), & pinnedMetrics ); err != nil {
201
+ if err := pinnedMetrics . UnmarshalMessagePack (copyAndDestroyUnmanagedVector (metrics )); err != nil {
204
202
return nil , err
205
203
}
206
204
Original file line number Diff line number Diff line change 4
4
"encoding/json"
5
5
"fmt"
6
6
"strconv"
7
+
8
+ "github.com/vmihailenco/msgpack/v5"
7
9
)
8
10
9
11
// Uint64 is a wrapper for uint64, but it is marshalled to and from JSON as a string
@@ -198,6 +200,10 @@ type PinnedMetrics struct {
198
200
PerModule PerModuleMetrics `json:"per_module"`
199
201
}
200
202
203
+ func (pm * PinnedMetrics ) UnmarshalMessagePack (data []byte ) error {
204
+ return msgpack .Unmarshal (data , pm )
205
+ }
206
+
201
207
// Array is a wrapper around a slice that ensures that we get "[]" JSON for nil values.
202
208
// When unmarshaling, we get an empty slice for "[]" and "null".
203
209
//
You can’t perform that action at this time.
0 commit comments