Skip to content

Commit

Permalink
chore(deps): update fxamacker/cbor to v2.7.0 (#663)
Browse files Browse the repository at this point in the history
The encoder mode we used previously now has unwanted side effects, so we
create our own with only the options we need
  • Loading branch information
agaffney authored Jun 24, 2024
1 parent 1975873 commit 18627cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion cbor/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ import (

func Encode(data interface{}) ([]byte, error) {
buf := bytes.NewBuffer(nil)
em, err := _cbor.CoreDetEncOptions().EncModeWithTags(customTagSet)
opts := _cbor.EncOptions{
// Make sure that maps have ordered keys
Sort: _cbor.SortCoreDeterministic,
}
em, err := opts.EncModeWithTags(customTagSet)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toolchain go1.21.5
require (
filippo.io/edwards25519 v1.1.0
github.com/blinklabs-io/ouroboros-mock v0.3.1
github.com/fxamacker/cbor/v2 v2.6.0
github.com/fxamacker/cbor/v2 v2.7.0
github.com/jinzhu/copier v0.4.0
github.com/utxorpc/go-codegen v0.5.1
go.uber.org/goleak v1.3.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github.com/blinklabs-io/ouroboros-mock v0.3.1 h1:oQiMgH0VgsJIGy4lJGaySegObq5FsVg
github.com/blinklabs-io/ouroboros-mock v0.3.1/go.mod h1:6DosKZuBZ4mmvky3hXUzGZqqb/KhbwOiKOldwAtNoxc=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fxamacker/cbor/v2 v2.6.0 h1:sU6J2usfADwWlYDAFhZBQ6TnLFBHxgesMrQfQgk1tWA=
github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8=
Expand Down

0 comments on commit 18627cf

Please sign in to comment.