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/nt/seqid/v0

Package
Open in gnoweb ↗

Overview

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

Files (5)

  • README.mdmarkdown
  • gnomod.tomltoml
  • doc.gnogno
  • seqid.gnogno
  • seqid_test.gnogno
seqid_test.gnogno
1package seqid23import (4	"fmt"5	"strings"6	"testing"7)89func TestID(t *testing.T) {10	var i ID1112	for j := 0; j < 100; j++ {13		i.Next()14	}15	if i != 100 {16		t.Fatalf("invalid: wanted %d got %d", 100, i)17	}18}1920func TestID_Overflow(t *testing.T) {21	i := ID(maxID)2223	defer func() {24		err := recover()25		if !strings.Contains(fmt.Sprint(err), "next ID overflows") {26			t.Errorf("did not overflow")27		}28	}()2930	i.Next()31}3233func TestID_Binary(cur realm, t *testing.T) {34	var i ID35	prev := i.Binary()3637	for j := 0; j < 1000; j++ {38		cur := i.Next().Binary()39		if cur <= prev {40			t.Fatalf("cur %x > prev %x", cur, prev)41		}42		prev = cur43	}44}4546func TestID_String(cur realm, t *testing.T) {47	var i ID48	prev := i.String()4950	for j := 0; j < 1000; j++ {51		cur := i.Next().String()52		if cur <= prev {53			t.Fatalf("cur %s > prev %s", cur, prev)54		}55		prev = cur56	}5758	// Test for when cford32 switches over to the long encoding.59	i = 1<<34 - 51260	for j := 0; j < 1024; j++ {61		cur := i.Next().String()62		// println(cur)63		if cur <= prev {64			t.Fatalf("cur %s > prev %s", cur, prev)65		}66		prev = cur67	}68}69

Functions

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

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