PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/p/moul/x/wiki/v0

Package
Open in gnoweb ↗

Overview

Kind
Pure package
Name
v0
Namespace
moul / x / wiki
Files
18 (README)(gnomod.toml)
Exported functions
n/a — not supported for pure packages by the node (vm/qfuncs)
Module
gno.land/p/moul/x/wiki/v0
gno
0.9

Files (18)

  • README.mdmarkdown
  • gnomod.tomltoml
  • diff.gnogno
  • doc.gnogno
  • links.gnogno
  • page.gnogno
  • render.gnogno
  • revision.gnogno
  • talk.gnogno
  • title.gnogno
  • wiki.gnogno
  • diff_test.gnogno
  • limits_test.gnogno
  • links_test.gnogno
  • render_test.gnogno
  • talk_test.gnogno
  • title_test.gnogno
  • wiki_test.gnogno
  • limits_test.gnogno
    1package wiki23import (4	"strings"5	"testing"67	"gno.land/p/nt/uassert/v0"8)910// maxLines is how many typical lines fit in DefaultMaxBody: 32 KiB at 4311// bytes per line.12const maxLines = 7581314func buildLines(n int) string {15	var b strings.Builder16	for i := 0; i < n; i++ {17		b.WriteString("some article line of moderate length here.\n")18	}19	return b.String()20}2122// TestWorstCaseRendersStayWithinTheQueryBudget exercises the two render paths23// at the largest body MaxBody admits.24//25// vm/qrender runs under a fixed ceiling (maxGasQuery = 3e9 in26// gno.land/pkg/sdk/vm/keeper.go), which a reader cannot raise, so a render27// that exceeds it makes the page permanently unreadable. Measured with28// `gno test -v` on gno master.184 (2026-09-17):29//30//	diff of a 33 KB body against itself plus one line    691M gas   23% of the ceiling31//	article render of a 33 KB body with links            693M gas   23% of the ceiling32//33// gno test reports gas per test function but a test cannot assert on it, so34// this test pins the shape, not the number: it fails if either path starts35// panicking or truncating at the limit. Re-measure with `gno test -v` and36// update the table when either path changes.37func TestWorstCaseRendersStayWithinTheQueryBudget(t *testing.T) {38	w := New(3, DefaultMaxBody)39	body := buildLines(maxLines-2) + "see [[Other page]]\n[[Category:Big]]\n"40	uassert.True(t, len(body) < DefaultMaxBody, "the fixture must fit in MaxBody")4142	now, h := at(1)43	_, err := w.Edit(alice, now, h, "Big", body, "", false)44	uassert.NoError(t, err)4546	p, err := w.Page("Big")47	uassert.NoError(t, err)4849	c := Ctx{Base: "/r/moul/x/wiki/v0", Exists: w.Exists}50	uassert.True(t, len(RenderArticle(c, w, p, nil)) > len(body), "the article must render in full")5152	now, h = at(2)53	_, err = w.Edit(alice, now, h, "Big", body+"added\n", "", false)54	uassert.NoError(t, err)5556	hist := p.History(0, 2)57	out := RenderDiff(c, p, hist[1], hist[0])58	uassert.True(t, strings.Contains(out, "+1 −0 lines"), "a one-line append to a 32 KiB body diffs exactly")59}60

    Functions

    not supported for pure packages by the node (vm/qfuncs)

    Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.