Skip to content

Commit b0c608c

Browse files
committed
docs: Fix markdown lint of transactions file
1 parent b98acaa commit b0c608c

2 files changed

Lines changed: 46 additions & 13 deletions

File tree

docs/runtime/transactions.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
1010
## accounts
1111

1212
### accounts.Addresses (query) {#accounts-addresses}
13+
1314
[[Rust][rust-accounts.Addresses] | [Go][go-accounts.Addresses] | [TypeScript][typescript-accounts.Addresses]]
1415

1516
#### Parameters [[Rust][rust-accounts.Addresses-params] | [Go][go-accounts.Addresses-params] | [TypeScript][typescript-accounts.Addresses-params]]
@@ -24,6 +25,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
2425
[typescript-accounts.Addresses-params]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/types.ts#L111-L116
2526

2627
### accounts.Balances (query) {#accounts-balances}
28+
2729
[[Rust][rust-accounts.Balances] | [Go][go-accounts.Balances] | [TypeScript][typescript-accounts.Balances]]
2830

2931
#### Parameters [[Rust][rust-accounts.Balances-params] | [Go][go-accounts.Balances-params] | [TypeScript][typescript-accounts.Balances-params]]
@@ -44,6 +46,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
4446
[typescript-accounts.Balances-result]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/types.ts#L80-L85
4547

4648
### accounts.DenominationInfo (query) {#accounts-denominationinfo}
49+
4750
[[Rust][rust-accounts.DenominationInfo] | [Go][go-accounts.DenominationInfo] | [TypeScript][typescript-accounts.DenominationInfo]]
4851

4952
#### Parameters [[Rust][rust-accounts.DenominationInfo-params] | [Go][go-accounts.DenominationInfo-params] | [TypeScript][typescript-accounts.DenominationInfo-params]]
@@ -67,6 +70,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
6770
[typescript-accounts.DenominationInfo-result]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/types.ts#L125-L130
6871

6972
### accounts.Nonce (query) {#accounts-nonce}
73+
7074
[[Rust][rust-accounts.Nonce] | [Go][go-accounts.Nonce] | [TypeScript][typescript-accounts.Nonce]]
7175

7276
#### Parameters [[Rust][rust-accounts.Nonce-params] | [Go][go-accounts.Nonce-params] | [TypeScript][typescript-accounts.Nonce-params]]
@@ -81,6 +85,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
8185
[typescript-accounts.Nonce-params]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/types.ts#L104-L109
8286

8387
### accounts.Transfer (call) {#accounts-transfer}
88+
8489
[[Rust][rust-accounts.Transfer] | [Go][go-accounts.Transfer] | [TypeScript][typescript-accounts.Transfer]]
8590

8691
#### Parameters [[Rust][rust-accounts.Transfer-params] | [Go][go-accounts.Transfer-params] | [TypeScript][typescript-accounts.Transfer-params]]
@@ -98,6 +103,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
98103
## consensus
99104

100105
### consensus.Account (query) {#consensus-account}
106+
101107
[[Rust][rust-consensus.Account] | [TypeScript][typescript-consensus.Account]]
102108

103109
#### Parameters [[Rust][rust-consensus.Account-params] | [Go][go-consensus.Account-params] | [TypeScript][typescript-consensus.Account-params]]
@@ -111,6 +117,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
111117
[typescript-consensus.Account-params]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/types.ts#L366-L371
112118

113119
### consensus.Balance (query) {#consensus-balance}
120+
114121
[[Rust][rust-consensus.Balance] | [Go][go-consensus.Balance] | [TypeScript][typescript-consensus.Balance]]
115122

116123
#### Parameters [[Rust][rust-consensus.Balance-params] | [Go][go-consensus.Balance-params] | [TypeScript][typescript-consensus.Balance-params]]
@@ -131,6 +138,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
131138
[typescript-consensus.Balance-result]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/types.ts#L359-L364
132139

133140
### consensus.Deposit (call) {#consensus-deposit}
141+
134142
[[Rust][rust-consensus.Deposit] | [Go][go-consensus.Deposit] | [TypeScript][typescript-consensus.Deposit]]
135143

136144
#### Parameters [[Rust][rust-consensus.Deposit-params] | [Go][go-consensus.Deposit-params] | [TypeScript][typescript-consensus.Deposit-params]]
@@ -146,6 +154,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
146154
[typescript-consensus.Deposit-params]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/types.ts#L336-L342
147155

148156
### consensus.Withdraw (call) {#consensus-withdraw}
157+
149158
[[Rust][rust-consensus.Withdraw] | [Go][go-consensus.Withdraw] | [TypeScript][typescript-consensus.Withdraw]]
150159

151160
#### Parameters [[Rust][rust-consensus.Withdraw-params] | [Go][go-consensus.Withdraw-params] | [TypeScript][typescript-consensus.Withdraw-params]]
@@ -163,6 +172,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
163172
## contracts
164173

165174
### contracts.Call (call) {#contracts-call}
175+
166176
[[Rust][rust-contracts.Call] | [Go][go-contracts.Call] | [TypeScript][typescript-contracts.Call]]
167177

168178
#### Parameters [[Rust][rust-contracts.Call-params] | [Go][go-contracts.Call-params] | [TypeScript][typescript-contracts.Call-params]]
@@ -182,7 +192,6 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
182192

183193
#### Result [[Go][go-contracts.Call-result]]
184194

185-
186195
[rust-contracts.Call]: https://github.com/oasisprotocol/oasis-sdk/tree/master/runtime-sdk/modules/contracts/src/lib.rs#L493-L536
187196
[go-contracts.Call]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/go/modules/contracts/contracts.go#L144-L147
188197
[typescript-contracts.Call]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/contracts.ts#L58-L60
@@ -192,6 +201,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
192201
[go-contracts.Call-result]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/go/modules/contracts/types.go#L119-L120
193202

194203
### contracts.Code (query) {#contracts-code}
204+
195205
[[Rust][rust-contracts.Code] | [Go][go-contracts.Code] | [TypeScript][typescript-contracts.Code]]
196206

197207
#### Parameters [[Rust][rust-contracts.Code-params] | [Go][go-contracts.Code-params] | [TypeScript][typescript-contracts.Code-params]]
@@ -234,6 +244,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
234244
[typescript-contracts.Code-result]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/types.ts#L584-L608
235245

236246
### contracts.Custom (query) {#contracts-custom}
247+
237248
[[Rust][rust-contracts.Custom] | [Go][go-contracts.Custom] | [TypeScript][typescript-contracts.Custom]]
238249

239250
#### Parameters [[Rust][rust-contracts.Custom-params] | [Go][go-contracts.Custom-params] | [TypeScript][typescript-contracts.Custom-params]]
@@ -249,7 +260,6 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
249260

250261
#### Result [[Go][go-contracts.Custom-result]]
251262

252-
253263
[rust-contracts.Custom]: https://github.com/oasisprotocol/oasis-sdk/tree/master/runtime-sdk/modules/contracts/src/lib.rs#L645-L680
254264
[go-contracts.Custom]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/go/modules/contracts/contracts.go#L214-L224
255265
[typescript-contracts.Custom]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/contracts.ts#L81-L83
@@ -259,6 +269,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
259269
[go-contracts.Custom-result]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/go/modules/contracts/types.go#L194-L195
260270

261271
### contracts.Instance (query) {#contracts-instance}
272+
262273
[[Rust][rust-contracts.Instance] | [Go][go-contracts.Instance] | [TypeScript][typescript-contracts.Instance]]
263274

264275
#### Parameters [[Rust][rust-contracts.Instance-params] | [Go][go-contracts.Instance-params] | [TypeScript][typescript-contracts.Instance-params]]
@@ -297,6 +308,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
297308
[typescript-contracts.Instance-result]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/types.ts#L620-L640
298309

299310
### contracts.InstanceStorage (query) {#contracts-instancestorage}
311+
300312
[[Rust][rust-contracts.InstanceStorage] | [Go][go-contracts.InstanceStorage] | [TypeScript][typescript-contracts.InstanceStorage]]
301313

302314
#### Parameters [[Rust][rust-contracts.InstanceStorage-params] | [Go][go-contracts.InstanceStorage-params]]
@@ -326,6 +338,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
326338
[go-contracts.InstanceStorage-result]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/go/modules/contracts/types.go#L154-L158
327339

328340
### contracts.Instantiate (call) {#contracts-instantiate}
341+
329342
[[Rust][rust-contracts.Instantiate] | [Go][go-contracts.Instantiate] | [TypeScript][typescript-contracts.Instantiate]]
330343

331344
#### Parameters [[Rust][rust-contracts.Instantiate-params] | [Go][go-contracts.Instantiate-params] | [TypeScript][typescript-contracts.Instantiate-params]]
@@ -365,6 +378,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
365378
[typescript-contracts.Instantiate-result]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/types.ts#L524-L532
366379

367380
### contracts.PublicKey (query) {#contracts-publickey}
381+
368382
[[Rust][rust-contracts.PublicKey] | [Go][go-contracts.PublicKey] | [TypeScript][typescript-contracts.PublicKey]]
369383

370384
#### Parameters [[Rust][rust-contracts.PublicKey-params] | [Go][go-contracts.PublicKey-params] | [TypeScript][typescript-contracts.PublicKey-params]]
@@ -404,6 +418,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
404418
[typescript-contracts.PublicKey-result]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/types.ts#L677-L693
405419

406420
### contracts.Upgrade (call) {#contracts-upgrade}
421+
407422
[[Rust][rust-contracts.Upgrade] | [Go][go-contracts.Upgrade] | [TypeScript][typescript-contracts.Upgrade]]
408423

409424
#### Parameters [[Rust][rust-contracts.Upgrade-params] | [Go][go-contracts.Upgrade-params] | [TypeScript][typescript-contracts.Upgrade-params]]
@@ -433,6 +448,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
433448
[typescript-contracts.Upgrade-params]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/types.ts#L552-L572
434449

435450
### contracts.Upload (call) {#contracts-upload}
451+
436452
[[Rust][rust-contracts.Upload] | [Go][go-contracts.Upload] | [TypeScript][typescript-contracts.Upload]]
437453

438454
#### Parameters [[Rust][rust-contracts.Upload-params] | [Go][go-contracts.Upload-params] | [TypeScript][typescript-contracts.Upload-params]]
@@ -470,6 +486,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
470486
## core
471487

472488
### core.CallDataPublicKey (query) {#core-calldatapublickey}
489+
473490
[[Rust][rust-core.CallDataPublicKey] | [TypeScript][typescript-core.CallDataPublicKey]]
474491

475492
#### Parameters [[Rust][rust-core.CallDataPublicKey-params]]
@@ -493,6 +510,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
493510
[typescript-core.CallDataPublicKey-result]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/types.ts#L11-L19
494511

495512
### core.CheckInvariants (query) {#core-checkinvariants}
513+
496514
[[Rust][rust-core.CheckInvariants] | [TypeScript][typescript-core.CheckInvariants]]
497515

498516
#### Parameters [[Rust][rust-core.CheckInvariants-params]]
@@ -515,6 +533,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
515533
[rust-core.CheckInvariants-result]: https://github.com/oasisprotocol/oasis-sdk/tree/master/runtime-sdk/src/modules/core/types.rs#L29-L34
516534

517535
### core.EstimateGas (query) {#core-estimategas}
536+
518537
[[Rust][rust-core.EstimateGas] | [Go][go-core.EstimateGas] | [TypeScript][typescript-core.EstimateGas]]
519538

520539
#### Parameters [[Rust][rust-core.EstimateGas-params] | [Go][go-core.EstimateGas-params] | [TypeScript][typescript-core.EstimateGas-params]]
@@ -533,6 +552,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
533552
[typescript-core.EstimateGas-params]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/types.ts#L3-L9
534553

535554
### core.MinGasPrice (query) {#core-mingasprice}
555+
536556
[[Rust][rust-core.MinGasPrice] | [Go][go-core.MinGasPrice] | [TypeScript][typescript-core.MinGasPrice]]
537557

538558
#### Parameters [[Rust][rust-core.MinGasPrice-params]]
@@ -548,6 +568,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
548568
[rust-core.MinGasPrice-params]: https://github.com/oasisprotocol/oasis-sdk/tree/master/runtime-sdk/src/modules/core/types.rs#L11-L16
549569

550570
### core.RuntimeInfo (query) {#core-runtimeinfo}
571+
551572
[[Rust][rust-core.RuntimeInfo] | [Go][go-core.RuntimeInfo] | [TypeScript][typescript-core.RuntimeInfo]]
552573

553574
#### Parameters [[Rust][rust-core.RuntimeInfo-params]]
@@ -559,7 +580,6 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
559580

560581
#### Result [[TypeScript][typescript-core.RuntimeInfo-result]]
561582

562-
563583
[rust-core.RuntimeInfo]: https://github.com/oasisprotocol/oasis-sdk/tree/master/runtime-sdk/src/modules/core/mod.rs#L475-L486
564584
[go-core.RuntimeInfo]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/go/modules/core/core.go#L141-L149
565585
[typescript-core.RuntimeInfo]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/core.ts#L71-L73
@@ -569,6 +589,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
569589
## evm
570590

571591
### evm.Balance (query) {#evm-balance}
592+
572593
[[Rust][rust-evm.Balance] | [Go][go-evm.Balance] | [TypeScript][typescript-evm.Balance]]
573594

574595
#### Parameters [[Rust][rust-evm.Balance-params] | [Go][go-evm.Balance-params] | [TypeScript][typescript-evm.Balance-params]]
@@ -583,6 +604,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
583604
[typescript-evm.Balance-params]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/types.ts#L426-L431
584605

585606
### evm.Call (call) {#evm-call}
607+
586608
[[Rust][rust-evm.Call] | [Go][go-evm.Call] | [TypeScript][typescript-evm.Call]]
587609

588610
#### Parameters [[Rust][rust-evm.Call-params] | [Go][go-evm.Call-params] | [TypeScript][typescript-evm.Call-params]]
@@ -599,6 +621,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
599621
[typescript-evm.Call-params]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/types.ts#L402-L409
600622

601623
### evm.Code (query) {#evm-code}
624+
602625
[[Rust][rust-evm.Code] | [Go][go-evm.Code] | [TypeScript][typescript-evm.Code]]
603626

604627
#### Parameters [[Rust][rust-evm.Code-params] | [Go][go-evm.Code-params] | [TypeScript][typescript-evm.Code-params]]
@@ -613,6 +636,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
613636
[typescript-evm.Code-params]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/types.ts#L419-L424
614637

615638
### evm.Create (call) {#evm-create}
639+
616640
[[Rust][rust-evm.Create] | [Go][go-evm.Create] | [TypeScript][typescript-evm.Create]]
617641

618642
#### Parameters [[Rust][rust-evm.Create-params] | [Go][go-evm.Create-params] | [TypeScript][typescript-evm.Create-params]]
@@ -628,6 +652,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
628652
[typescript-evm.Create-params]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/types.ts#L394-L400
629653

630654
### evm.SimulateCall (query) {#evm-simulatecall}
655+
631656
[[Rust][rust-evm.SimulateCall] | [Go][go-evm.SimulateCall] | [TypeScript][typescript-evm.SimulateCall]]
632657

633658
#### Parameters [[Rust][rust-evm.SimulateCall-params] | [Go][go-evm.SimulateCall-params] | [TypeScript][typescript-evm.SimulateCall-params]]
@@ -647,6 +672,7 @@ with references to Go, Rust and TypeScript bindings in Oasis SDK.
647672
[typescript-evm.SimulateCall-params]: https://github.com/oasisprotocol/oasis-sdk/tree/master/client-sdk/ts-web/rt/src/types.ts#L433-L443
648673

649674
### evm.Storage (query) {#evm-storage}
675+
650676
[[Rust][rust-evm.Storage] | [Go][go-evm.Storage] | [TypeScript][typescript-evm.Storage]]
651677

652678
#### Parameters [[Rust][rust-evm.Storage-params] | [Go][go-evm.Storage-params] | [TypeScript][typescript-evm.Storage-params]]

tools/extract-runtime-txs/main.go

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@ var (
2929
scriptName = filepath.Base(os.Args[0])
3030

3131
rootCmd = &cobra.Command{
32-
Use: scriptName,
33-
Short: "Extracts Runtime transactions from formatted Rust, Go and TypeScript code.",
34-
Long: "See README.md for details.",
35-
Example: "./extract-runtime-txs --codebase.path ../.. --markdown",
36-
Run: doExtractRuntimeTxs,
32+
Use: scriptName,
33+
Short: "Extracts Runtime transactions from formatted Rust, Go and TypeScript code.",
34+
Example: `./extract-runtime-txs \
35+
--codebase.path ../.. \
36+
--markdown \
37+
--markdown.template.file ../../docs/runtime/transactions.md.tpl \
38+
--codebase.url https://github.com/oasisprotocol/oasis-sdk/tree/master/ \
39+
> ../../docs/runtime/transactions.md`,
40+
Run: doExtractRuntimeTxs,
3741
}
3842
)
3943

@@ -76,7 +80,7 @@ func markdownRef(fullName string, snippets map[types.Lang]types.Snippet, t types
7680

7781
// markdownParams generates a markdown list of parameter or results fields of the transaction.
7882
func markdownParams(params []types.Parameter) string {
79-
paramsStr := "\n"
83+
paramsStr := ""
8084
for _, p := range params {
8185
paramsStr += fmt.Sprintf("- `%s: %s`\n", p.Name, p.Type)
8286
if p.Description != "" {
@@ -132,12 +136,15 @@ func printMarkdown(transactions map[string]types.Tx) {
132136
markdown += fmt.Sprintf("## %s\n\n", tx.Module)
133137
lastModule = tx.Module
134138
}
135-
markdown += fmt.Sprintf("### %s (%s) {#%s}\n", tx.FullName(), tx.Type, tx.Module+"-"+strings.ToLower(tx.Name))
139+
markdown += fmt.Sprintf("### %s (%s) {#%s}\n\n", tx.FullName(), tx.Type, tx.Module+"-"+strings.ToLower(tx.Name))
136140
markdown += fmt.Sprintf("%s\n\n", markdownRef(tx.FullName(), tx.Ref, types.Base))
137-
markdown += fmt.Sprintf("#### Parameters %s\n%s\n", markdownRef(tx.FullName(), tx.ParametersRef, types.Params), markdownParams(tx.Parameters))
141+
markdown += fmt.Sprintf("#### Parameters %s\n\n%s\n", markdownRef(tx.FullName(), tx.ParametersRef, types.Params), markdownParams(tx.Parameters))
138142

139-
if tx.Result != nil || len(tx.ResultRef) > 0 {
140-
markdown += fmt.Sprintf("#### Result %s\n%s\n", markdownRef(tx.FullName(), tx.ResultRef, types.Result), markdownParams(tx.Result))
143+
if len(tx.ResultRef) > 0 {
144+
markdown += fmt.Sprintf("#### Result %s\n\n", markdownRef(tx.FullName(), tx.ResultRef, types.Result))
145+
if tx.Result != nil {
146+
markdown += fmt.Sprintf("%s\n", markdownParams(tx.Result))
147+
}
141148
}
142149

143150
markdown += markdownRefSrcs(tx.FullName(), tx.Ref, types.Base)

0 commit comments

Comments
 (0)