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/gnoland/boards/v0

Package
Open in gnoweb ↗

Overview

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

Files (22)

  • gnomod.tomltoml
  • board.gnogno
  • flag_storage.gnogno
  • id.gnogno
  • permission_set.gnogno
  • permissions.gnogno
  • post_storage.gnogno
  • post.gnogno
  • reply.gnogno
  • repost_storage.gnogno
  • storage.gnogno
  • thread.gnogno
  • board_test.gnogno
  • flag_storage_test.gnogno
  • id_test.gnogno
  • permission_set_test.gnogno
  • post_storage_test.gnogno
  • post_test.gnogno
  • reply_test.gnogno
  • repost_storage_test.gnogno
  • storage_test.gnogno
  • thread_test.gnogno
  • permission_set_test.gnogno
    1package boards23import (4	"testing"56	"gno.land/p/nt/uassert/v0"7)89func TestNewPermissionSet(t *testing.T) {10	cases := []struct {11		name  string12		perms []Permission13		check []Permission14		want  bool15	}{16		{17			name:  "empty",18			check: []Permission{0},19			want:  false,20		},21		{22			name:  "single permission",23			perms: []Permission{0},24			check: []Permission{0},25			want:  true,26		},27		{28			name:  "multiple permissions",29			perms: []Permission{1, 3, 5},30			check: []Permission{1, 3, 5},31			want:  true,32		},33		{34			name:  "high permission value",35			perms: []Permission{100},36			check: []Permission{100},37			want:  true,38		},39		{40			name:  "missing permission",41			perms: []Permission{100},42			check: []Permission{0},43			want:  false,44		},45		{46			name:  "multiple missing permissions",47			perms: []Permission{1, 3, 5},48			check: []Permission{0, 2, 4},49			want:  false,50		},51	}5253	for _, tc := range cases {54		t.Run(tc.name, func(t *testing.T) {55			s := NewPermissionSet(tc.perms...)5657			for _, p := range tc.check {58				uassert.Equal(t, tc.want, s.Has(p))59			}60		})61	}62}6364func TestPermissionSetHas(t *testing.T) {65	cases := []struct {66		name  string67		set   PermissionSet68		check Permission69		want  bool70	}{71		{72			name:  "out of range",73			set:   NewPermissionSet(0),74			check: 100,75			want:  false,76		},77		{78			name:  "nil set",79			check: 0,80			want:  false,81		},82		{83			name:  "permission present",84			set:   NewPermissionSet(5),85			check: 5,86			want:  true,87		},88	}8990	for _, tc := range cases {91		t.Run(tc.name, func(t *testing.T) {92			uassert.Equal(t, tc.want, tc.set.Has(tc.check))93		})94	}95}9697func TestPermissionSetIsEmpty(t *testing.T) {98	cases := []struct {99		name string100		set  PermissionSet101		want bool102	}{103		{104			name: "nil set",105			want: true,106		},107		{108			name: "non-empty set",109			set:  NewPermissionSet(0),110			want: false,111		},112		{113			name: "empty allocated set",114			set:  make(PermissionSet, 1),115			want: true,116		},117	}118119	for _, tc := range cases {120		t.Run(tc.name, func(t *testing.T) {121			uassert.Equal(t, tc.want, tc.set.IsEmpty())122		})123	}124}125

    Functions

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

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