Skip to content

Commit

Permalink
fix(grpc): change enum type to numeric for documentation (#1474)
Browse files Browse the repository at this point in the history
  • Loading branch information
b00f authored Aug 16, 2024
1 parent e773444 commit 57b9bec
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 106 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ devtools:
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
go install github.com/NathanBaulch/[email protected]
go install github.com/pactus-project/protoc-gen-doc/cmd/[email protected]20240619124021-76fc28241eb6
go install github.com/pactus-project/protoc-gen-doc/cmd/[email protected]20240815105130-84e89d0170e4
go install github.com/bufbuild/buf/cmd/[email protected]
go install mvdan.cc/gofumpt@latest
go install github.com/rakyll/[email protected]
Expand Down
8 changes: 4 additions & 4 deletions www/grpc/buf/grpc-md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Each PAC is equivalent to 1,000,000,000 or 10<sup>9</sup> NanoPACs.
{{with getEnum .LongType }}{{- print "" -}}
<br>Available values:<ul>
{{range .Values}}{{- print "" -}}
<li>{{ .Name}} = {{ .Description }}</li>
<li>{{.Name}} = {{.Number}} ({{ .Description }})</li>
{{end}}{{- print "" -}}
</ul>
{{end}}{{- print "" -}}
Expand Down Expand Up @@ -99,7 +99,7 @@ Message has no fields.
{{with getEnum .LongType }}{{- print "" -}}
<br>Available values:<ul>
{{range .Values}}{{- print "" -}}
<li>{{ .Name}} = {{ .Description }}</li>
<li>{{.Name}} = {{.Number}} ({{ .Description }})</li>
{{end}}{{- print "" -}}
</ul>
{{end}}{{- print "" -}}
Expand All @@ -119,7 +119,7 @@ Message has no fields.
{{with getEnum .LongType }}{{- print "" -}}
<br>Available values:<ul>
{{range .Values}}{{- print "" -}}
<li>{{ .Name}} = {{ .Description }}</li>
<li>{{.Name}} = {{.Number}} ({{ .Description }})</li>
{{end}}{{- print "" -}}
</ul>
{{end}}{{- print "" -}}
Expand All @@ -139,7 +139,7 @@ Message has no fields.
{{with getEnum .LongType }}{{- print "" -}}
<br>Available values:<ul>
{{range .Values}}{{- print "" -}}
<li>{{ .Name}} = {{ .Description }}</li>
<li>{{.Name}} = {{.Number}} ({{ .Description }})</li>
{{end}}{{- print "" -}}
</ul>
{{end}}{{- print "" -}}
Expand Down
8 changes: 4 additions & 4 deletions www/grpc/buf/json-rpc-md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ curl --location 'http://localhost:8545/' \
{{with getEnum .LongType }}{{- print "" -}}
<br>Available values:<ul>
{{range .Values}}{{- print "" -}}
<li>{{ .Name}} = {{ .Description }}</li>
<li>{{.Name}} = {{.Number}} ({{ .Description }})</li>
{{end}}{{- print "" -}}
</ul>
{{end}}{{- print "" -}}
Expand Down Expand Up @@ -150,7 +150,7 @@ Parameters has no fields.
{{with getEnum .LongType }}{{- print "" -}}
<br>Available values:<ul>
{{range .Values}}{{- print "" -}}
<li>{{ .Name}} = {{ .Description }}</li>
<li>{{.Name}} = {{.Number}} ({{ .Description }})</li>
{{end}}{{- print "" -}}
</ul>
{{end}}{{- print "" -}}
Expand All @@ -170,7 +170,7 @@ Parameters has no fields.
{{with getEnum .LongType }}{{- print "" -}}
<br>Available values:<ul>
{{range .Values}}{{- print "" -}}
<li>{{ .Name}} = {{ .Description }}</li>
<li>{{.Name}} = {{.Number}} ({{ .Description }})</li>
{{end}}{{- print "" -}}
</ul>
{{end}}{{- print "" -}}
Expand All @@ -190,7 +190,7 @@ Parameters has no fields.
{{with getEnum .LongType }}{{- print "" -}}
<br>Available values:<ul>
{{range .Values}}{{- print "" -}}
<li>{{ .Name}} = {{ .Description }}</li>
<li>{{.Name}} = {{.Number}} ({{ .Description }})</li>
{{end}}{{- print "" -}}
</ul>
{{end}}{{- print "" -}}
Expand Down
85 changes: 43 additions & 42 deletions www/grpc/gen/docs/grpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ parameters.</p>
<td>
(Enum) The verbosity level for transaction details.
<br>Available values:<ul>
<li>TRANSACTION_DATA = Request transaction data only.</li>
<li>TRANSACTION_INFO = Request detailed transaction information.</li>
<li>TRANSACTION_DATA = 0 (Request transaction data only.)</li>
<li>TRANSACTION_INFO = 1 (Request detailed transaction information.)</li>
</ul>
</td>
</tr>
Expand Down Expand Up @@ -279,12 +279,12 @@ parameters.</p>
<td>
(Enum) The type of transaction payload.
<br>Available values:<ul>
<li>UNKNOWN = Unknown payload type.</li>
<li>TRANSFER_PAYLOAD = Transfer payload type.</li>
<li>BOND_PAYLOAD = Bond payload type.</li>
<li>SORTITION_PAYLOAD = Sortition payload type.</li>
<li>UNBOND_PAYLOAD = Unbond payload type.</li>
<li>WITHDRAW_PAYLOAD = Withdraw payload type.</li>
<li>UNKNOWN = 0 (Unknown payload type.)</li>
<li>TRANSFER_PAYLOAD = 1 (Transfer payload type.)</li>
<li>BOND_PAYLOAD = 2 (Bond payload type.)</li>
<li>SORTITION_PAYLOAD = 3 (Sortition payload type.)</li>
<li>UNBOND_PAYLOAD = 4 (Unbond payload type.)</li>
<li>WITHDRAW_PAYLOAD = 5 (Withdraw payload type.)</li>
</ul>
</td>
</tr>
Expand Down Expand Up @@ -456,12 +456,12 @@ and payload type.</p>
<td>
(Enum) The type of transaction payload.
<br>Available values:<ul>
<li>UNKNOWN = Unknown payload type.</li>
<li>TRANSFER_PAYLOAD = Transfer payload type.</li>
<li>BOND_PAYLOAD = Bond payload type.</li>
<li>SORTITION_PAYLOAD = Sortition payload type.</li>
<li>UNBOND_PAYLOAD = Unbond payload type.</li>
<li>WITHDRAW_PAYLOAD = Withdraw payload type.</li>
<li>UNKNOWN = 0 (Unknown payload type.)</li>
<li>TRANSFER_PAYLOAD = 1 (Transfer payload type.)</li>
<li>BOND_PAYLOAD = 2 (Bond payload type.)</li>
<li>SORTITION_PAYLOAD = 3 (Sortition payload type.)</li>
<li>UNBOND_PAYLOAD = 4 (Unbond payload type.)</li>
<li>WITHDRAW_PAYLOAD = 5 (Withdraw payload type.)</li>
</ul>
</td>
</tr>
Expand Down Expand Up @@ -842,9 +842,9 @@ parameters.</p>
<td>
(Enum) The verbosity level for block information.
<br>Available values:<ul>
<li>BLOCK_DATA = Request only block data.</li>
<li>BLOCK_INFO = Request block information and transaction IDs.</li>
<li>BLOCK_TRANSACTIONS = Request block information and detailed transaction data.</li>
<li>BLOCK_DATA = 0 (Request only block data.)</li>
<li>BLOCK_INFO = 1 (Request block information and transaction IDs.)</li>
<li>BLOCK_TRANSACTIONS = 2 (Request block information and detailed transaction data.)</li>
</ul>
</td>
</tr>
Expand Down Expand Up @@ -1025,12 +1025,12 @@ BLOCK_TRANSACTIONS.
<td>
(Enum) The type of transaction payload.
<br>Available values:<ul>
<li>UNKNOWN = Unknown payload type.</li>
<li>TRANSFER_PAYLOAD = Transfer payload type.</li>
<li>BOND_PAYLOAD = Bond payload type.</li>
<li>SORTITION_PAYLOAD = Sortition payload type.</li>
<li>UNBOND_PAYLOAD = Unbond payload type.</li>
<li>WITHDRAW_PAYLOAD = Withdraw payload type.</li>
<li>UNKNOWN = 0 (Unknown payload type.)</li>
<li>TRANSFER_PAYLOAD = 1 (Transfer payload type.)</li>
<li>BOND_PAYLOAD = 2 (Bond payload type.)</li>
<li>SORTITION_PAYLOAD = 3 (Sortition payload type.)</li>
<li>UNBOND_PAYLOAD = 4 (Unbond payload type.)</li>
<li>WITHDRAW_PAYLOAD = 5 (Withdraw payload type.)</li>
</ul>
</td>
</tr>
Expand Down Expand Up @@ -1471,10 +1471,10 @@ committee.
<td>
(Enum) The type of the vote.
<br>Available values:<ul>
<li>VOTE_UNKNOWN = Unknown vote type.</li>
<li>VOTE_PREPARE = Prepare vote type.</li>
<li>VOTE_PRECOMMIT = Precommit vote type.</li>
<li>VOTE_CHANGE_PROPOSER = Change proposer vote type.</li>
<li>VOTE_UNKNOWN = 0 (Unknown vote type.)</li>
<li>VOTE_PREPARE = 1 (Prepare vote type.)</li>
<li>VOTE_PRECOMMIT = 2 (Precommit vote type.)</li>
<li>VOTE_CHANGE_PROPOSER = 3 (Change proposer vote type.)</li>
</ul>
</td>
</tr>
Expand Down Expand Up @@ -1885,12 +1885,12 @@ address.</p>
(Enum) The type of transactions to retrieve from the transaction pool. 0 means all
types.
<br>Available values:<ul>
<li>UNKNOWN = Unknown payload type.</li>
<li>TRANSFER_PAYLOAD = Transfer payload type.</li>
<li>BOND_PAYLOAD = Bond payload type.</li>
<li>SORTITION_PAYLOAD = Sortition payload type.</li>
<li>UNBOND_PAYLOAD = Unbond payload type.</li>
<li>WITHDRAW_PAYLOAD = Withdraw payload type.</li>
<li>UNKNOWN = 0 (Unknown payload type.)</li>
<li>TRANSFER_PAYLOAD = 1 (Transfer payload type.)</li>
<li>BOND_PAYLOAD = 2 (Bond payload type.)</li>
<li>SORTITION_PAYLOAD = 3 (Sortition payload type.)</li>
<li>UNBOND_PAYLOAD = 4 (Unbond payload type.)</li>
<li>WITHDRAW_PAYLOAD = 5 (Withdraw payload type.)</li>
</ul>
</td>
</tr>
Expand Down Expand Up @@ -1958,12 +1958,12 @@ types.
<td>
(Enum) The type of transaction payload.
<br>Available values:<ul>
<li>UNKNOWN = Unknown payload type.</li>
<li>TRANSFER_PAYLOAD = Transfer payload type.</li>
<li>BOND_PAYLOAD = Bond payload type.</li>
<li>SORTITION_PAYLOAD = Sortition payload type.</li>
<li>UNBOND_PAYLOAD = Unbond payload type.</li>
<li>WITHDRAW_PAYLOAD = Withdraw payload type.</li>
<li>UNKNOWN = 0 (Unknown payload type.)</li>
<li>TRANSFER_PAYLOAD = 1 (Transfer payload type.)</li>
<li>BOND_PAYLOAD = 2 (Bond payload type.)</li>
<li>SORTITION_PAYLOAD = 3 (Sortition payload type.)</li>
<li>UNBOND_PAYLOAD = 4 (Unbond payload type.)</li>
<li>WITHDRAW_PAYLOAD = 5 (Withdraw payload type.)</li>
</ul>
</td>
</tr>
Expand Down Expand Up @@ -2885,9 +2885,10 @@ public key.</p>
<td>
(Enum) The type of address to generate.
<br>Available values:<ul>
<li>ADDRESS_TYPE_TREASURY = </li>
<li>ADDRESS_TYPE_VALIDATOR = </li>
<li>ADDRESS_TYPE_BLS_ACCOUNT = </li>
<li>ADDRESS_TYPE_TREASURY = 0 (Treasury address type.
Should not be used to generate new addresses.)</li>
<li>ADDRESS_TYPE_VALIDATOR = 1 (Validator address type.)</li>
<li>ADDRESS_TYPE_BLS_ACCOUNT = 2 (Account address type with BLS signature scheme.)</li>
</ul>
</td>
</tr>
Expand Down
Loading

0 comments on commit 57b9bec

Please sign in to comment.