Skip to content

Commit 18627cf

Browse files
authored
chore(deps): update fxamacker/cbor to v2.7.0 (#663)
The encoder mode we used previously now has unwanted side effects, so we create our own with only the options we need
1 parent 1975873 commit 18627cf

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

cbor/encode.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ import (
2525

2626
func Encode(data interface{}) ([]byte, error) {
2727
buf := bytes.NewBuffer(nil)
28-
em, err := _cbor.CoreDetEncOptions().EncModeWithTags(customTagSet)
28+
opts := _cbor.EncOptions{
29+
// Make sure that maps have ordered keys
30+
Sort: _cbor.SortCoreDeterministic,
31+
}
32+
em, err := opts.EncModeWithTags(customTagSet)
2933
if err != nil {
3034
return nil, err
3135
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toolchain go1.21.5
77
require (
88
filippo.io/edwards25519 v1.1.0
99
github.com/blinklabs-io/ouroboros-mock v0.3.1
10-
github.com/fxamacker/cbor/v2 v2.6.0
10+
github.com/fxamacker/cbor/v2 v2.7.0
1111
github.com/jinzhu/copier v0.4.0
1212
github.com/utxorpc/go-codegen v0.5.1
1313
go.uber.org/goleak v1.3.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ github.com/blinklabs-io/ouroboros-mock v0.3.1 h1:oQiMgH0VgsJIGy4lJGaySegObq5FsVg
44
github.com/blinklabs-io/ouroboros-mock v0.3.1/go.mod h1:6DosKZuBZ4mmvky3hXUzGZqqb/KhbwOiKOldwAtNoxc=
55
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
66
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
7-
github.com/fxamacker/cbor/v2 v2.6.0 h1:sU6J2usfADwWlYDAFhZBQ6TnLFBHxgesMrQfQgk1tWA=
8-
github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
7+
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
8+
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
99
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
1010
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
1111
github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8=

0 commit comments

Comments
 (0)