Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_2_filetest.gno

1.17 Kb ยท 45 lines
 1// PKGPATH: gno.land/r/gnops/valopers_test
 2// SEND: 20000000ugnot
 3
 4package valopers_test
 5
 6import (
 7	"testing"
 8
 9	"gno.land/p/nt/testutils"
10	"gno.land/r/gnops/valopers"
11)
12
13var g1user = testutils.TestAddress("g1user")
14
15const (
16	validMoniker     = "test-1"
17	validDescription = "test-1's description"
18	validServerType  = valopers.ServerTypeOnPrem
19	validAddress     = address("g1sp8v98h2gadm5jggtzz9w5ksexqn68ympsd68h")
20	validPubKey      = "gpub1pggj7ard9eg82cjtv4u52epjx56nzwgjyg9zqwpdwpd0f9fvqla089ndw5g9hcsufad77fml2vlu73fk8q8sh8v72cza5p"
21)
22
23func init() {
24	testing.SetOriginCaller(g1user)
25
26	// Register a validator and add the proposal
27	valopers.Register(cross, validMoniker, validDescription, validServerType, validAddress, validPubKey)
28}
29
30func main() {
31	// Simulate clicking on the validator
32	println(valopers.Render(validAddress.String()))
33}
34
35// Output:
36// Valoper's details:
37// ## test-1
38// test-1's description
39//
40// - Address: g1sp8v98h2gadm5jggtzz9w5ksexqn68ympsd68h
41// - PubKey: gpub1pggj7ard9eg82cjtv4u52epjx56nzwgjyg9zqwpdwpd0f9fvqla089ndw5g9hcsufad77fml2vlu73fk8q8sh8v72cza5p
42// - Server Type: on-prem
43//
44// [Profile link](/r/demo/profile:u/g1sp8v98h2gadm5jggtzz9w5ksexqn68ympsd68h)
45//