From 9acdc74feef900e4bd6b21b0a72712f75f57e0dd Mon Sep 17 00:00:00 2001 From: gohumble Date: Tue, 7 May 2024 10:50:43 +0200 Subject: [PATCH] gogo protobuf --- buf.lock | 7 +------ buf.yaml | 1 - cashu.proto | 2 +- info.proto | 2 +- keys.proto | 5 ++--- melt.proto | 2 +- message.proto | 2 +- mint.proto | 15 +++++++-------- proofs.proto | 3 ++- signature.proto | 2 +- state.proto | 2 +- swap.proto | 2 +- token.proto | 4 +--- 13 files changed, 20 insertions(+), 29 deletions(-) diff --git a/buf.lock b/buf.lock index 9f985f8..592f6d2 100644 --- a/buf.lock +++ b/buf.lock @@ -9,10 +9,5 @@ deps: - remote: buf.build owner: googleapis repository: googleapis - commit: 74015a8aeb8445aa9e3e1454cb54bc35 + commit: 14bdc09318b24694992b8c84f63e3681 digest: shake256:7149cf5e9955c692d381e557830555d4e93f205a0f1b8e2dfdae46d029369aa3fc1980e35df0d310f7cc3b622f93e19ad276769a283a967dd3065ddfd3a40e13 - - remote: buf.build - owner: srikrsna - repository: protoc-gen-gotag - commit: 7a85d3ad2e7642c198480e92bf730c14 - digest: shake256:059f136681cd47abe2d6e83d20b9594071c481572d16cebfafbc81ba3d3e7924aef6974f99da53d67a01d033e30b7bf57985a206b4e856fc82508545de84a70c diff --git a/buf.yaml b/buf.yaml index 3842c30..f1967d5 100644 --- a/buf.yaml +++ b/buf.yaml @@ -8,5 +8,4 @@ lint: - DEFAULT deps: - buf.build/googleapis/googleapis - - buf.build/srikrsna/protoc-gen-gotag - buf.build/gogo/protobuf \ No newline at end of file diff --git a/cashu.proto b/cashu.proto index 031f5a1..e56fdb4 100644 --- a/cashu.proto +++ b/cashu.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package cashu.v1; -option go_package = "github.com/cashu/rpc/cashu"; +option go_package = "gen/go/cashurpc"; import "keys.proto"; import "swap.proto"; diff --git a/info.proto b/info.proto index dd00b26..a70c9ff 100644 --- a/info.proto +++ b/info.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package cashu.v1; import "mint.proto"; -option go_package = "github.com/cashu/rpc/info"; +option go_package = "gen/go/cashurpc"; enum MethodType { method_unspecified = 0; diff --git a/keys.proto b/keys.proto index 50253bd..cbd2e85 100644 --- a/keys.proto +++ b/keys.proto @@ -1,11 +1,10 @@ syntax = "proto3"; -import "tagger/tagger.proto"; package cashu.v1; -option go_package = "github.com/cashu/rpc/keys"; +option go_package = "gen/go/cashurpc"; message KeysResponse{ - repeated Keyset keysets = 1 [(tagger.tags) = "json:\"keysets\""]; + repeated Keyset keysets = 1; } message KeysRequest{ diff --git a/melt.proto b/melt.proto index a33bff7..bab113f 100644 --- a/melt.proto +++ b/melt.proto @@ -3,7 +3,7 @@ syntax = "proto3"; import "mint.proto"; import "proofs.proto"; package cashu.v1; -option go_package = "github.com/cashu/rpc/melt"; +option go_package = "gen/go/cashurpc"; message GetQuoteBolt11StateRequest { string quote_id = 1; diff --git a/message.proto b/message.proto index f992d1d..8d69495 100644 --- a/message.proto +++ b/message.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package cashu.v1; -option go_package = "github.com/cashu/rpc/message"; +option go_package = "gen/go/cashurpc"; message BlindedMessage { uint64 amount = 1; diff --git a/mint.proto b/mint.proto index 9e46d43..af2feb0 100644 --- a/mint.proto +++ b/mint.proto @@ -2,10 +2,9 @@ syntax = "proto3"; import "message.proto"; import "signature.proto"; -import "tagger/tagger.proto"; import "gogoproto/gogo.proto"; package cashu.v1; -option go_package = "github.com/cashu/rpc/mint"; +option go_package = "gen/go/cashurpc"; enum UnitType { @@ -20,16 +19,16 @@ message PostMintQuoteBolt11Request { } message PostMintQuoteBolt11Response { - string quote = 1 [json_name = "quote"]; - string request = 2 [json_name = "request"]; - bool paid = 3 [json_name = "paid",(gogoproto.jsontag) = "paid"]; - int64 expiry = 4 [json_name = "expiry",(gogoproto.jsontag) = "expiry"]; + string quote = 1 [(gogoproto.jsontag) = "quotes",(gogoproto.moretags) = "xml=\"dawg\"" ]; + string request = 2[(gogoproto.jsontag) = "request"]; + bool paid = 3 [(gogoproto.jsontag) = "paid"]; + int64 expiry = 4 [(gogoproto.jsontag) = "exp"]; } message PostMintBolt11Request { - string quote = 1 [(tagger.tags) = "json:\"quote\""]; - repeated BlindedMessage outputs = 3 [(tagger.tags) = "json:\"outputs\""]; + string quote = 1 ; + repeated BlindedMessage outputs = 3; } diff --git a/proofs.proto b/proofs.proto index edb19ed..272ee8f 100644 --- a/proofs.proto +++ b/proofs.proto @@ -1,7 +1,8 @@ syntax = "proto3"; package cashu.v1; -option go_package = "github.com/cashu/rpc/proofs"; +option go_package = "gen/go/cashurpc"; + message Proof { uint64 amount = 1; string id = 2; diff --git a/signature.proto b/signature.proto index ce0c300..1fbb38a 100644 --- a/signature.proto +++ b/signature.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package cashu.v1; -option go_package = "github.com/cashu/rpc/signature"; +option go_package = "gen/go/cashurpc"; message BlindedSignature { string id = 1; diff --git a/state.proto b/state.proto index 02ffa39..31d2013 100644 --- a/state.proto +++ b/state.proto @@ -4,7 +4,7 @@ import "message.proto"; import "signature.proto"; package cashu.v1; -option go_package = "github.com/cashu/rpc/state"; +option go_package = "gen/go/cashurpc"; message PostCheckStateRequest { repeated string secrets = 1; diff --git a/swap.proto b/swap.proto index 30dd60f..f20b9f5 100644 --- a/swap.proto +++ b/swap.proto @@ -4,7 +4,7 @@ import "proofs.proto"; import "message.proto"; import "signature.proto"; package cashu.v1; -option go_package = "github.com/cashu/rpc/swap"; +option go_package = "gen/go/cashurpc"; message SwapResponse { repeated BlindedSignature signatures = 1; diff --git a/token.proto b/token.proto index 07cda22..a72b40f 100644 --- a/token.proto +++ b/token.proto @@ -1,10 +1,8 @@ syntax = "proto3"; -import "tagger/tagger.proto"; - import "proofs.proto"; package cashu.v1; -option go_package = "github.com/cashu/rpc/token"; +option go_package = "gen/go/cashurpc"; message TokenV3 {