Skip to content
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

chore: reformat proto files and restore proto docs #212

Merged
merged 1 commit into from
May 28, 2021
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
10,043 changes: 10,043 additions & 0 deletions docs/core/proto-docs.md

Large diffs are not rendered by default.

105 changes: 105 additions & 0 deletions docs/protodoc-markdown.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<!-- This file is auto-generated. Please do not modify it yourself. -->
# Protobuf Documentation
<a name="top"></a>

## Table of Contents
{{range .Files}}
{{$file_name := .Name}}- [{{.Name}}](#{{.Name}})
{{- if .Messages }}
{{range .Messages}} - [{{.LongName}}](#{{.FullName}})
{{end}}
{{- end -}}
{{- if .Enums }}
{{range .Enums}} - [{{.LongName}}](#{{.FullName}})
{{end}}
{{- end -}}
{{- if .Extensions }}
{{range .Extensions}} - [File-level Extensions](#{{$file_name}}-extensions)
{{end}}
{{- end -}}
{{- if .Services }}
{{range .Services}} - [{{.Name}}](#{{.FullName}})
{{end}}
{{- end -}}
{{end}}
- [Scalar Value Types](#scalar-value-types)

{{range .Files}}
{{$file_name := .Name}}
<a name="{{.Name}}"></a>
<p align="right"><a href="#top">Top</a></p>

## {{.Name}}
{{.Description}}

{{range .Messages}}
<a name="{{.FullName}}"></a>

### {{.LongName}}
{{.Description}}

{{if .HasFields}}
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
{{range .Fields -}}
| `{{.Name}}` | [{{.LongType}}](#{{.FullType}}) | {{.Label}} | {{if (index .Options "deprecated"|default false)}}**Deprecated.** {{end}}{{nobr .Description}}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end}} |
{{end}}
{{end}}

{{if .HasExtensions}}
| Extension | Type | Base | Number | Description |
| --------- | ---- | ---- | ------ | ----------- |
{{range .Extensions -}}
| `{{.Name}}` | {{.LongType}} | {{.ContainingLongType}} | {{.Number}} | {{nobr .Description}}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end}} |
{{end}}
{{end}}

{{end}} <!-- end messages -->

{{range .Enums}}
<a name="{{.FullName}}"></a>

### {{.LongName}}
{{.Description}}

| Name | Number | Description |
| ---- | ------ | ----------- |
{{range .Values -}}
| {{.Name}} | {{.Number}} | {{nobr .Description}} |
{{end}}

{{end}} <!-- end enums -->

{{if .HasExtensions}}
<a name="{{$file_name}}-extensions"></a>

### File-level Extensions
| Extension | Type | Base | Number | Description |
| --------- | ---- | ---- | ------ | ----------- |
{{range .Extensions -}}
| `{{.Name}}` | {{.LongType}} | {{.ContainingLongType}} | {{.Number}} | {{nobr .Description}}{{if .DefaultValue}} Default: `{{.DefaultValue}}`{{end}} |
{{end}}
{{end}} <!-- end HasExtensions -->

{{range .Services}}
<a name="{{.FullName}}"></a>

### {{.Name}}
{{.Description}}

| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
{{range .Methods -}}
| `{{.Name}}` | [{{.RequestLongType}}](#{{.RequestFullType}}){{if .RequestStreaming}} stream{{end}} | [{{.ResponseLongType}}](#{{.ResponseFullType}}){{if .ResponseStreaming}} stream{{end}} | {{nobr .Description}} | {{with (index .Options "google.api.http")}}{{range .Rules}}{{.Method}}|{{.Pattern}}{{end}}{{end}}|
{{end}}
{{end}} <!-- end services -->

{{end}}

## Scalar Value Types

| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
{{range .Scalars -}}
| <a name="{{.ProtoType}}" /> {{.ProtoType}} | {{.Notes}} | {{.CppType}} | {{.JavaType}} | {{.PythonType}} | {{.GoType}} | {{.CSharp}} | {{.PhpType}} | {{.RubyType}} |
{{end}}
4 changes: 2 additions & 2 deletions proto/lbm/bank/v1beta1/bank.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ message Input {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

string address = 1;
string address = 1;
repeated lbm.base.v1beta1.Coin coins = 2
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/line/lbm-sdk/v2/types.Coins"];
}
Expand All @@ -38,7 +38,7 @@ message Output {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

string address = 1;
string address = 1;
repeated lbm.base.v1beta1.Coin coins = 2
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/line/lbm-sdk/v2/types.Coins"];
}
Expand Down
4 changes: 2 additions & 2 deletions proto/lbm/bank/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ message MsgSend {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""];
string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""];
string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""];
string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""];
repeated lbm.base.v1beta1.Coin amount = 3
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/line/lbm-sdk/v2/types.Coins"];
}
Expand Down
3 changes: 1 addition & 2 deletions proto/lbm/crisis/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ import "lbm/base/v1beta1/coin.proto";
message GenesisState {
// constant_fee is the fee used to verify the invariant in the crisis
// module.
lbm.base.v1beta1.Coin constant_fee = 3
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"constant_fee\""];
lbm.base.v1beta1.Coin constant_fee = 3 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"constant_fee\""];
}
6 changes: 3 additions & 3 deletions proto/lbm/distribution/v1beta1/distribution.proto
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ message CommunityPoolSpendProposal {
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

string title = 1;
string description = 2;
string recipient = 3;
string title = 1;
string description = 2;
string recipient = 3;
repeated lbm.base.v1beta1.Coin amount = 4
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/line/lbm-sdk/v2/types.Coins"];
}
Expand Down
4 changes: 2 additions & 2 deletions proto/lbm/gov/v1beta1/gov.proto
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ message Deposit {
option (gogoproto.goproto_getters) = false;
option (gogoproto.equal) = false;

uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""];
string depositor = 2;
uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""];
string depositor = 2;
repeated lbm.base.v1beta1.Coin amount = 3
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/line/lbm-sdk/v2/types.Coins"];
}
Expand Down
2 changes: 1 addition & 1 deletion proto/lbm/gov/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ message MsgSubmitProposal {
option (gogoproto.stringer) = false;
option (gogoproto.goproto_getters) = false;

google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"];
google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"];
repeated lbm.base.v1beta1.Coin initial_deposit = 2 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/line/lbm-sdk/v2/types.Coins",
Expand Down
20 changes: 10 additions & 10 deletions proto/lbm/staking/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ message MsgCreateValidator {
(gogoproto.moretags) = "yaml:\"min_self_delegation\"",
(gogoproto.nullable) = false
];
string delegator_address = 4 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
string validator_address = 5 [(gogoproto.moretags) = "yaml:\"validator_address\""];
google.protobuf.Any pubkey = 6 [(cosmos_proto.accepts_interface) = "lbm.crypto.PubKey"];
string delegator_address = 4 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
string validator_address = 5 [(gogoproto.moretags) = "yaml:\"validator_address\""];
google.protobuf.Any pubkey = 6 [(cosmos_proto.accepts_interface) = "lbm.crypto.PubKey"];
lbm.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false];
}

Expand Down Expand Up @@ -84,8 +84,8 @@ message MsgDelegate {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""];
string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""];
lbm.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false];
}

Expand All @@ -98,9 +98,9 @@ message MsgBeginRedelegate {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""];
string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""];
string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""];
string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""];
lbm.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false];
}

Expand All @@ -115,8 +115,8 @@ message MsgUndelegate {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""];
string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""];
lbm.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false];
}

Expand Down
4 changes: 2 additions & 2 deletions proto/lbm/vesting/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ service Msg {
message MsgCreateVestingAccount {
option (gogoproto.equal) = true;

string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""];
string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""];
string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""];
string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""];
repeated lbm.base.v1beta1.Coin amount = 3
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/line/lbm-sdk/v2/types.Coins"];

Expand Down
2 changes: 1 addition & 1 deletion proto/lbm/vesting/v1beta1/vesting.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ message DelayedVestingAccount {
message Period {
option (gogoproto.goproto_stringer) = false;

int64 length = 1;
int64 length = 1;
repeated lbm.base.v1beta1.Coin amount = 2
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/line/lbm-sdk/v2/types.Coins"];
}
Expand Down
4 changes: 2 additions & 2 deletions testutil/testdata/unknonwnproto.proto
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ message TestUpdatedTxBody {
message TestUpdatedAuthInfo {
repeated lbm.tx.v1beta1.SignerInfo signer_infos = 1;
lbm.tx.v1beta1.Fee fee = 2;
bytes new_field_3 = 3;
bytes new_field_1024 = 1024;
bytes new_field_3 = 3;
bytes new_field_1024 = 1024;
}

message TestRepeatedUints {
Expand Down