mockprofile.gno

0.37 Kb ยท 19 lines
 1package mockprofile
 2
 3import "gno.land/p/nt/avl"
 4
 5type MockProfile struct {
 6	fields avl.Tree
 7}
 8
 9func (p *MockProfile) GetProfileString(addr address, field string, def string) string {
10	v, ok := p.fields.Get(field)
11	if !ok {
12		return def
13	}
14	return v.(string)
15}
16
17func (p *MockProfile) SetStringField(cur realm, field, value string) bool {
18	return p.fields.Set(field, value)
19}