helpers_test.gno
0.96 Kb · 25 lines
1package gnopm
2
3// Fixtures shared by the tests in this package.
4//
5// addrNS is moul's mainnet address, used wherever a test needs a real bech32
6// address rather than a plausible-looking string: the address-namespace rule
7// turns on the bech32 alphabet, so a made-up "g1aaa..." would pass or fail for
8// the wrong reason.
9const (
10 addrNS = "g1manfred47kzduec920z88wfr64ylksmdcedlf5"
11 alice = address("g1ubwjz3jmrjwmpuvrsjzgy5qkxf5wrgphzmd2tk")
12 bob = address("g1e8vw6gh284q7ggzqs66ug0zvyf42tzsf5zdhsk")
13 carol = address("g1v9kxjcm9ta047h6lta047h6lta047h6lz7gmv8")
14 sha1Zero = "0000000000000000000000000000000000000000"
15 sha1One = "1111111111111111111111111111111111111111"
16)
17
18// resolver builds an r/sys/users stand-in from a name -> address table, so the
19// ownership rule is tested without importing a realm.
20func resolver(table map[string]address) func(string) (address, bool) {
21 return func(name string) (address, bool) {
22 a, ok := table[name]
23 return a, ok
24 }
25}