Skip to content

Commit

Permalink
Add go_package option and change imports for proper Go code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
philippgille committed Jun 23, 2019
1 parent e5b86ee commit 0138dd3
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 21 deletions.
10 changes: 6 additions & 4 deletions rpc/admission_control/admission_control.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions rpc/mempool/mempool_status.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option go_package = "github.com/philippgille/libra-sdk-go/rpc/mempool";

package mempool;

enum MempoolAddTransactionStatus {
Expand Down
2 changes: 2 additions & 0 deletions rpc/types/access_path.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option go_package = "github.com/philippgille/libra-sdk-go/rpc/types";

package types;

message AccessPath {
Expand Down
4 changes: 3 additions & 1 deletion rpc/types/account_state_blob.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down
6 changes: 4 additions & 2 deletions rpc/types/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
14 changes: 8 additions & 6 deletions rpc/types/get_with_proof.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions rpc/types/ledger_info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion rpc/types/proof.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions rpc/types/transaction.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions rpc/types/transaction_info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions rpc/types/validator_change.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions rpc/types/validator_public_keys.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion rpc/types/validator_set.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions rpc/types/vm_errors.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0138dd3

Please sign in to comment.