From e515b9797f25565955207594448664e32a5e35b0 Mon Sep 17 00:00:00 2001 From: Gerry Agbobada <10496163+gagbo@users.noreply.github.com> Date: Mon, 22 Mar 2021 10:58:25 +0100 Subject: [PATCH] fix(build): change magefile/protofile to stop using . as go_package (#27) --- magefile.go | 13 ++++++++----- pb/bitcoin/service.proto | 4 +++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/magefile.go b/magefile.go index ecb7c94..c639727 100644 --- a/magefile.go +++ b/magefile.go @@ -14,9 +14,10 @@ const ( entryPoint = "cmd/lbs.go" ldFlags = "-X $PACKAGE/version/version.commitHash=$COMMIT_HASH " + "-X $PACKAGE/version/version.buildDate=$BUILD_DATE" - protoPlugins = "plugins=grpc" - protoDir = "pb/bitcoin" - protoFileName = "service.proto" + protoPlugins = "plugins=grpc" + protoDir = "pb" + protoFileName = "bitcoin/service.proto" + protoArtifactModule = "github.com/ledgerhq/bitcoin-lib-grpc/pb" ) // Allow user to override executables on UNIX-like systems. @@ -44,8 +45,10 @@ func init() { func Proto() error { return sh.Run(protoc, - fmt.Sprintf("--go_out=%s:%s", protoPlugins, protoDir), // protoc flags - fmt.Sprintf("%s/%s", protoDir, protoFileName)) // input .proto + fmt.Sprintf("--go_out=%s:%s", protoPlugins, protoDir), // protoc flags + fmt.Sprintf("%s/%s", protoDir, protoFileName), // input .proto + fmt.Sprintf("--go_opt=module=%s", protoArtifactModule), // module output + ) } func Buf() error { diff --git a/pb/bitcoin/service.proto b/pb/bitcoin/service.proto index bdd5dad..072814f 100644 --- a/pb/bitcoin/service.proto +++ b/pb/bitcoin/service.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package pb.bitcoin; -option go_package = ".;bitcoin"; +option go_package = "github.com/ledgerhq/bitcoin-lib-grpc/pb/bitcoin"; option java_package = "co.ledger.protobuf.bitcoin.libgrpc"; // CoinService exposes a gRPC interface to wrap protocol-centric logic @@ -237,8 +237,10 @@ message RawTransactionResponse { // Same as hash if no witness is present. string witness_hash = 3; + // Amount of change generated to the change address int64 change_amount = 4; + // The total fees for the transaction int64 total_fees = 5; // If not enough utxos to pay for fees.