Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: pre-register test1 user to make interaction with boards easier #2823

Merged
merged 9 commits into from
Sep 26, 2024
3 changes: 3 additions & 0 deletions examples/gno.land/r/demo/users/preregister.gno
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ var preRegisteredUsers = []struct {
{"nt", "g15ge0ae9077eh40erwrn2eq0xw6wupwqthpv34l"}, // -> @r_nt
{"sys", "g1r929wt2qplfawe4lvqv9zuwfdcz4vxdun7qh8l"}, // -> @r_sys
{"x", "g164sdpew3c2t3rvxj3kmfv7c7ujlvcw2punzzuz"}, // -> @r_x

// test1 user
{"test1", "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5"}, // -> @test1
}

func init() {
Expand Down
22 changes: 22 additions & 0 deletions examples/gno.land/r/demo/users/z_13_filetest.gno
hthieu1110 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package main

// SEND: 200000000ugnot
thehowl marked this conversation as resolved.
Show resolved Hide resolved

import (
"strconv"

"gno.land/r/demo/users"
)

func main() {
{
hthieu1110 marked this conversation as resolved.
Show resolved Hide resolved
// Verify pre-registered test1 user
names := users.ListUsersByPrefix("test1", 1)
println("# names: " + strconv.Itoa(len(names)))
println("name: " + names[0])
}
}

// Output:
// # names: 1
// name: test1
1 change: 1 addition & 0 deletions examples/gno.land/r/demo/users/z_5_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func main() {
// * [nt](/r/demo/users:nt)
// * [satoshi](/r/demo/users:satoshi)
// * [sys](/r/demo/users:sys)
// * [test1](/r/demo/users:test1)
// * [x](/r/demo/users:x)
//
// ========================================
Expand Down
Loading