From 0138dd311f951b276bcdec8af34a1eea33736f82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Gill=C3=A9?= Date: Sun, 23 Jun 2019 14:57:30 +0200 Subject: [PATCH] Add go_package option and change imports for proper Go code generation --- rpc/admission_control/admission_control.proto | 10 ++++++---- rpc/mempool/mempool_status.proto | 2 ++ rpc/types/access_path.proto | 2 ++ rpc/types/account_state_blob.proto | 4 +++- rpc/types/events.proto | 6 ++++-- rpc/types/get_with_proof.proto | 14 ++++++++------ rpc/types/ledger_info.proto | 2 ++ rpc/types/proof.proto | 4 +++- rpc/types/transaction.proto | 10 ++++++---- rpc/types/transaction_info.proto | 2 ++ rpc/types/validator_change.proto | 6 ++++-- rpc/types/validator_public_keys.proto | 2 ++ rpc/types/validator_set.proto | 4 +++- rpc/types/vm_errors.proto | 2 ++ 14 files changed, 49 insertions(+), 21 deletions(-) diff --git a/rpc/admission_control/admission_control.proto b/rpc/admission_control/admission_control.proto index 7ba00e9..18784a5 100644 --- a/rpc/admission_control/admission_control.proto +++ b/rpc/admission_control/admission_control.proto @@ -3,12 +3,14 @@ syntax = "proto3"; +option go_package = "github.com/philippgille/libra-sdk-go/rpc/admission_control"; + package admission_control; -import "get_with_proof.proto"; -import "mempool_status.proto"; -import "transaction.proto"; -import "vm_errors.proto"; +import "types/get_with_proof.proto"; +import "mempool/mempool_status.proto"; +import "types/transaction.proto"; +import "types/vm_errors.proto"; // ----------------------------------------------------------------------------- // ---------------- Submit transaction diff --git a/rpc/mempool/mempool_status.proto b/rpc/mempool/mempool_status.proto index 0405039..3549543 100644 --- a/rpc/mempool/mempool_status.proto +++ b/rpc/mempool/mempool_status.proto @@ -3,6 +3,8 @@ syntax = "proto3"; +option go_package = "github.com/philippgille/libra-sdk-go/rpc/mempool"; + package mempool; enum MempoolAddTransactionStatus { diff --git a/rpc/types/access_path.proto b/rpc/types/access_path.proto index d9cd672..faa9c61 100644 --- a/rpc/types/access_path.proto +++ b/rpc/types/access_path.proto @@ -3,6 +3,8 @@ syntax = "proto3"; +option go_package = "github.com/philippgille/libra-sdk-go/rpc/types"; + package types; message AccessPath { diff --git a/rpc/types/account_state_blob.proto b/rpc/types/account_state_blob.proto index d791c64..fe60b36 100644 --- a/rpc/types/account_state_blob.proto +++ b/rpc/types/account_state_blob.proto @@ -3,9 +3,11 @@ syntax = "proto3"; +option go_package = "github.com/philippgille/libra-sdk-go/rpc/types"; + package types; -import "proof.proto"; +import "types/proof.proto"; message AccountStateBlob { bytes blob = 1; } diff --git a/rpc/types/events.proto b/rpc/types/events.proto index a878d3c..9d13708 100644 --- a/rpc/types/events.proto +++ b/rpc/types/events.proto @@ -7,10 +7,12 @@ syntax = "proto3"; +option go_package = "github.com/philippgille/libra-sdk-go/rpc/types"; + package types; -import "access_path.proto"; -import "proof.proto"; +import "types/access_path.proto"; +import "types/proof.proto"; // An event emitted from a smart contract message Event { diff --git a/rpc/types/get_with_proof.proto b/rpc/types/get_with_proof.proto index a86f9a0..60b60da 100644 --- a/rpc/types/get_with_proof.proto +++ b/rpc/types/get_with_proof.proto @@ -108,14 +108,16 @@ // returned syntax = "proto3"; +option go_package = "github.com/philippgille/libra-sdk-go/rpc/types"; + package types; -import "access_path.proto"; -import "account_state_blob.proto"; -import "events.proto"; -import "ledger_info.proto"; -import "transaction.proto"; -import "validator_change.proto"; +import "types/access_path.proto"; +import "types/account_state_blob.proto"; +import "types/events.proto"; +import "types/ledger_info.proto"; +import "types/transaction.proto"; +import "types/validator_change.proto"; // ----------------------------------------------------------------------------- // ---------------- Update to latest ledger request diff --git a/rpc/types/ledger_info.proto b/rpc/types/ledger_info.proto index eddc9af..0850f40 100644 --- a/rpc/types/ledger_info.proto +++ b/rpc/types/ledger_info.proto @@ -3,6 +3,8 @@ syntax = "proto3"; +option go_package = "github.com/philippgille/libra-sdk-go/rpc/types"; + package types; /// Even though we don't always need all hashes, we pass them in and return them diff --git a/rpc/types/proof.proto b/rpc/types/proof.proto index 1037771..c6f51c0 100644 --- a/rpc/types/proof.proto +++ b/rpc/types/proof.proto @@ -3,9 +3,11 @@ syntax = "proto3"; +option go_package = "github.com/philippgille/libra-sdk-go/rpc/types"; + package types; -import "transaction_info.proto"; +import "types/transaction_info.proto"; message AccumulatorProof { // The bitmap indicating which siblings are default. 1 means non-default and diff --git a/rpc/types/transaction.proto b/rpc/types/transaction.proto index ac3c5f1..c15c17f 100644 --- a/rpc/types/transaction.proto +++ b/rpc/types/transaction.proto @@ -3,12 +3,14 @@ syntax = "proto3"; +option go_package = "github.com/philippgille/libra-sdk-go/rpc/types"; + package types; -import "access_path.proto"; -import "events.proto"; -import "proof.proto"; -import "transaction_info.proto"; +import "types/access_path.proto"; +import "types/events.proto"; +import "types/proof.proto"; +import "types/transaction_info.proto"; import "google/protobuf/wrappers.proto"; // A generic structure that describes a transaction that a client submits diff --git a/rpc/types/transaction_info.proto b/rpc/types/transaction_info.proto index d170734..98bada6 100644 --- a/rpc/types/transaction_info.proto +++ b/rpc/types/transaction_info.proto @@ -3,6 +3,8 @@ syntax = "proto3"; +option go_package = "github.com/philippgille/libra-sdk-go/rpc/types"; + package types; // `TransactionInfo` is the object we store in the transaction accumulator. It diff --git a/rpc/types/validator_change.proto b/rpc/types/validator_change.proto index 731db3b..64acc82 100644 --- a/rpc/types/validator_change.proto +++ b/rpc/types/validator_change.proto @@ -3,10 +3,12 @@ syntax = "proto3"; +option go_package = "github.com/philippgille/libra-sdk-go/rpc/types"; + package types; -import "events.proto"; -import "ledger_info.proto"; +import "types/events.proto"; +import "types/ledger_info.proto"; // This is used to prove validator changes. When a validator is changing, it // triggers an event on /validator_change_account/events/sent. To tell the diff --git a/rpc/types/validator_public_keys.proto b/rpc/types/validator_public_keys.proto index efcfcad..7a18054 100644 --- a/rpc/types/validator_public_keys.proto +++ b/rpc/types/validator_public_keys.proto @@ -3,6 +3,8 @@ syntax = "proto3"; +option go_package = "github.com/philippgille/libra-sdk-go/rpc/types"; + package types; // Protobuf definition for the Rust struct ValidatorPublicKeys diff --git a/rpc/types/validator_set.proto b/rpc/types/validator_set.proto index 2bec2a6..db3ae7a 100644 --- a/rpc/types/validator_set.proto +++ b/rpc/types/validator_set.proto @@ -3,9 +3,11 @@ syntax = "proto3"; +option go_package = "github.com/philippgille/libra-sdk-go/rpc/types"; + package types; -import "validator_public_keys.proto"; +import "types/validator_public_keys.proto"; // Protobuf definition for the Rust struct ValidatorSet. message ValidatorSet { diff --git a/rpc/types/vm_errors.proto b/rpc/types/vm_errors.proto index b29d32e..1e9a9af 100644 --- a/rpc/types/vm_errors.proto +++ b/rpc/types/vm_errors.proto @@ -3,6 +3,8 @@ syntax = "proto3"; +option go_package = "github.com/philippgille/libra-sdk-go/rpc/types"; + package types; // The statuses and errors produced by the VM can be categorized into a