Skip to content

deps: update protobuf #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ tagging versions.

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

Make sure you have `protoc` and
[protoc-gen-go](https://developers.google.com/protocol-buffers/docs/reference/go-generated)
installed:

`git clone https://github.com/digitalbitbox/bitbox02-firmware.git`

```sh
rm -rf api/firmware/messages/*
rm -rf api/firmware/messages/{*.pb.go,*.proto}
cp /path/to/bitbox02-firmware/messages/*.proto api/firmware/messages/
rm api/firmware/messages/backup.proto
go generate ./...
./api/firmware/messages/generate.sh
```
6 changes: 3 additions & 3 deletions api/firmware/btc.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/digitalbitbox/bitbox02-api-go/api/firmware/messages"
"github.com/digitalbitbox/bitbox02-api-go/util/errp"
"github.com/digitalbitbox/bitbox02-api-go/util/semver"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)

const multisigNameMaxLen = 30
Expand Down Expand Up @@ -277,7 +277,7 @@ func (device *Device) BTCSign(
switch next.Type {
case messages.BTCSignNextResponse_INPUT:
inputIndex := next.Index
input := *tx.Inputs[inputIndex].Input
input := tx.Inputs[inputIndex].Input

inputIsSchnorr := isTaproot(scriptConfigs[input.ScriptConfigIndex])

Expand All @@ -297,7 +297,7 @@ func (device *Device) BTCSign(
}
next, err = device.queryBtcSign(&messages.Request{
Request: &messages.Request_BtcSignInput{
BtcSignInput: &input,
BtcSignInput: input,
}})
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion api/firmware/btc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (

"github.com/digitalbitbox/bitbox02-api-go/api/firmware/messages"
"github.com/digitalbitbox/bitbox02-api-go/util/semver"
"github.com/golang/protobuf/proto"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/proto"
)

const hardenedKeyStart = 0x80000000
Expand Down
2 changes: 0 additions & 2 deletions api/firmware/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ import (
"github.com/flynn/noise"
)

//go:generate sh -c "protoc --proto_path=messages/ --go_out='import_path=messages,paths=source_relative:messages' messages/*.proto"

var (
lowestSupportedFirmwareVersion = semver.NewSemVer(9, 0, 0)
lowestSupportedFirmwareVersionBTCOnly = semver.NewSemVer(9, 0, 0)
Expand Down
2 changes: 1 addition & 1 deletion api/firmware/device_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"github.com/digitalbitbox/bitbox02-api-go/api/firmware/mocks"
"github.com/digitalbitbox/bitbox02-api-go/util/semver"
"github.com/flynn/noise"
"github.com/golang/protobuf/proto"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/proto"
)

// newDevice creates a device to test with, with init/pairing already processed.
Expand Down
Loading