Skip to content

Commit

Permalink
chore: fixup
Browse files Browse the repository at this point in the history
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
  • Loading branch information
moul committed May 12, 2022
1 parent d905eb4 commit 4fa4fea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/gno.land/r/profile/integration0_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import (

func main() {
fmt.Println("test")
// various data types
// avatar
// ip address
}

// Output:
4 changes: 4 additions & 0 deletions examples/gno.land/r/profile/profile.gno
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"gno.land/r/users"
)

// FIXME: manage privacy?

func newProfile(addr std.Address) *Profile {
now := std.GetTime()
return &Profile{
Expand All @@ -32,6 +34,8 @@ func (p *Profile) save() {
func (p *Profile) update(dict map[string]interface{}) {
for k, v := range dict {
// TODO: additional checks here
// TODO: check v.Type()
// TODO: check v.Len()
if k == "address" || k == "created" || k == "updated" {
panic("reserved profile key")
}
Expand Down
1 change: 1 addition & 0 deletions examples/gno.land/r/profile/profiles.gno
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
var profiles *avl.MutTree // std.Address.String() -> *Profile

func Update(dict map[string]interface{}) {
// FIXME: ask a price per stored data length?
currentUser := std.GetOrigCaller()
profile := getOrCreateProfileByAddress(currentUser)
profile.update(dict)
Expand Down

0 comments on commit 4fa4fea

Please sign in to comment.