render_example_test.gno
0.64 Kb · 25 lines
1package ratelimitdemo
2
3// ExampleRender pins the realm's Render output as a testable example.
4func ExampleRender() {
5 print(Render(""))
6 // Output:
7 // # Rate Limiter
8 //
9 // Demo of the [`p/moul/x/daily/ratelimit`](/p/nym-moultest123/x/daily/ratelimit/v0) library — an on-chain token-bucket limiter (port of `golang.org/x/time/rate`).
10 //
11 // ## Config
12 //
13 // | Parameter | Value |
14 // |---|---|
15 // | Rate (tokens/block) | 0.5 |
16 // | Burst (capacity) | 5 |
17 // | Clock height | 123 |
18 //
19 // ## Callers
20 //
21 // _No caller has hit the limiter yet._
22 //
23 // ---
24 // Call `Allow(cur)` to consume a token; read `Tokens(addr)` for a caller's balance.
25}