Skip to content

Commit c42bf9e

Browse files
committed
deps: update protobuf
The module we used previouly, github.com/golang/protobuf/proto, is deprecated. See https://github.com/golang/protobuf/releases/tag/v1.5.2 and golang/protobuf#1306. We use the official succssor: ``` (fix imports) go get google.golang.org/protobuf/[email protected] go mod tidy ``` The .pb.go generated files also needed to be updated with an updated protoc-gen-go: ``` go install google.golang.org/protobuf/cmd/[email protected] ``` A new script was added to generate the files, as the `import_path=messages` flag seems to be removed in favour of the `M` flag, which unfortunately has to be specified for each .proto file :(
1 parent 9c5dd0d commit c42bf9e

21 files changed

+7716
-4213
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ tagging versions.
77

88
Clone the [BitBox02 firmware repo](https://github.com/digitalbitbox/bitbox02-firmware):
99

10+
Make sure you have `protoc` and
11+
[protoc-gen-go](https://developers.google.com/protocol-buffers/docs/reference/go-generated)
12+
installed:
13+
1014
`git clone https://github.com/digitalbitbox/bitbox02-firmware.git`
1115

1216
```sh
1317
rm -rf api/firmware/messages/*
1418
cp /path/to/bitbox02-firmware/messages/*.proto api/firmware/messages/
1519
rm api/firmware/messages/backup.proto
16-
go generate ./...
20+
./api/firmware/messages/generate.sh
1721
```

api/firmware/btc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"github.com/digitalbitbox/bitbox02-api-go/api/firmware/messages"
2525
"github.com/digitalbitbox/bitbox02-api-go/util/errp"
2626
"github.com/digitalbitbox/bitbox02-api-go/util/semver"
27-
"github.com/golang/protobuf/proto"
27+
"google.golang.org/protobuf/proto"
2828
)
2929

3030
const multisigNameMaxLen = 30

api/firmware/btc_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import (
2020

2121
"github.com/digitalbitbox/bitbox02-api-go/api/firmware/messages"
2222
"github.com/digitalbitbox/bitbox02-api-go/util/semver"
23-
"github.com/golang/protobuf/proto"
2423
"github.com/stretchr/testify/require"
24+
"google.golang.org/protobuf/proto"
2525
)
2626

2727
const hardenedKeyStart = 0x80000000

api/firmware/device.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ import (
2727
"github.com/flynn/noise"
2828
)
2929

30-
//go:generate sh -c "protoc --proto_path=messages/ --go_out='import_path=messages,paths=source_relative:messages' messages/*.proto"
31-
3230
var (
3331
lowestSupportedFirmwareVersion = semver.NewSemVer(9, 0, 0)
3432
lowestSupportedFirmwareVersionBTCOnly = semver.NewSemVer(9, 0, 0)

api/firmware/device_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import (
2525
"github.com/digitalbitbox/bitbox02-api-go/api/firmware/mocks"
2626
"github.com/digitalbitbox/bitbox02-api-go/util/semver"
2727
"github.com/flynn/noise"
28-
"github.com/golang/protobuf/proto"
2928
"github.com/stretchr/testify/require"
29+
"google.golang.org/protobuf/proto"
3030
)
3131

3232
// newDevice creates a device to test with, with init/pairing already processed.

0 commit comments

Comments
 (0)