Transaction

F2F0B222C7F8E6…B80455644881

Block 26,106 · index 0 · indexed

Summary

Hash
F2F0B222C7F8E6C7EB118D71DE37319A0245A2DEA38BAC24F182B80455644881
Block
26,106
Size
4741 bytes
Gas used
9,208,737 / 11,050,544
Fee
1000000ugnot
Memo
gnopublish
Status
success

Messages

#1AddPackagegno.land/r/moul/x/daily/rledemo/v09 arguments

Arguments · 9

  1. #1rledemo
  2. #2README.md
  3. #3# Run-Length Encoding > ⚠️ **Experimental — generated with no human supervision** by the daily MCP pipeline to exercise gno tooling. Not audited. See [r/moul/x/daily](https://github.com/moul/gno-contracts/blob/main/r/moul/x/daily/README.md). --- Encodes a few samples, round-trips them, and reports the size ratio. ``` /r/moul/x/daily/rledemo/v0 → the samples table /r/moul/x/daily/rledemo/v0:aaabbc → encode your own text ``` Demo of the [`p/moul/x/daily/rle`](https://github.com/moul/gno-contracts/tree/main/p/moul/x/daily/rle/v0) library — no codec logic lives here. Stateless, so `Render` is deterministic. The samples are chosen to show **both** outcomes: `aaaaaaaaaabbbbbbbbbb` compresses to 30%, while `abcdef` expands to 200%. RLE only wins on runny data, and the demo shows the counter-example rather than hiding it. Built for gno 0.9. <!-- BEGIN GNOCONTRACTS FOOTER (generated by `make readmes`; do not edit below) --> --- Part of **[moul/gno-contracts](https://github.com/moul/gno-contracts)** — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage. **Dependency graph:** ![gno.land/r/moul/x/daily/rledemo/v0 dependency graph](https://raw.githubusercontent.com/moul/gno-contracts/main/_assets/gno.land/r/moul/x/daily/rledemo/v0/deps.png) > 🧪 **Highly experimental — potentially vibe-coded.** Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: [DISCLAIMER](https://github.com/moul/gno-contracts/blob/main/DISCLAIMER.md). <!-- END GNOCONTRACTS FOOTER -->
  4. #4gnomod.toml
  5. #5module = "gno.land/r/moul/x/daily/rledemo/v0" gno = "0.9"
  6. #6rledemo.gno
  7. #7// Package rledemo is a small gnoweb demo of the run-length codec provided by // the [p/moul/x/daily/rle](/p/moul/x/daily/rle/v0) library: it encodes a few // sample strings, round-trips them, and reports the size ratio — including the // case where the "compression" makes things bigger. // // It contains no codec logic of its own. Stateless, so Render is deterministic. package rledemo import ( "strconv" "strings" "gno.land/p/moul/x/daily/rle/v0" ) // samples are picked to show both outcomes: runny data compresses, data // without runs expands. var samples = []string{ "aaaaaaaaaabbbbbbbbbb", "aaabbc", "abcdef", } // Render renders the demo for gnoweb. // // Render("") / Render("/") -> the samples table // Render("/<text>") -> encode that text func Render(path string) string { var b strings.Builder b.WriteString("# Run-Length Encoding\n\n") b.WriteString("`<count><char>` pairs, demoing the ") b.WriteString("[`p/moul/x/daily/rle`](/p/moul/x/daily/rle/v0) library.\n\n") if in := parseArg(path); in != "" { return b.String() + one(in) } b.WriteString("| input | encoded | size | round-trips |\n|---|---|---|---|\n") for _, s := range samples { enc, err := rle.Encode(s) if err != nil { continue } dec, _ := rle.Decode(enc) b.WriteString("| `") b.WriteString(s) b.WriteString("` | `") b.WriteString(enc) b.WriteString("` | ") b.WriteString(strconv.Itoa(rle.Ratio(s, enc))) b.WriteString("% | ") if dec == s { b.WriteString("✅") } else { b.WriteString("❌") } b.WriteString(" |\n") } b.WriteString("\n> Over 100% means the encoding made the data **bigger**. ") b.WriteString("RLE only wins on runny input, and `abcdef` is the honest counter-example.\n\n") b.WriteString("> Append text to the path to encode it — digits are rejected, ") b.WriteString("since they would be ambiguous with a run count.\n") return b.String() } func one(in string) string { var b strings.Builder b.WriteString("## `") b.WriteString(in) b.WriteString("`\n\n") enc, err := rle.Encode(in) if err != nil { b.WriteString("_") b.WriteString(err.Error()) b.WriteString("_\n") return b.String() } dec, _ := rle.Decode(enc) b.WriteString("- encoded: `") b.WriteString(enc) b.WriteString("`\n- size: **") b.WriteString(strconv.Itoa(rle.Ratio(in, enc))) b.WriteString("%**\n- round-trips: ") if dec == in { b.WriteString("✅\n") } else { b.WriteString("❌\n") } return b.String() } func parseArg(path string) string { s := strings.TrimSpace(path) s = strings.TrimPrefix(s, "/") if i := strings.IndexByte(s, '/'); i >= 0 { s = s[:i] } return s }
  8. #8/gno.MemPackageType
  9. #9 MPUserProd

Result log

msg:0,success:true,log:,events:[]

← Back to block 26,106