From 4fa4feadd6b7db7a881b7fb786f6aad7e73aa596 Mon Sep 17 00:00:00 2001 From: Manfred Touron <94029+moul@users.noreply.github.com> Date: Mon, 9 May 2022 15:45:59 +0000 Subject: [PATCH] chore: fixup Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com> --- examples/gno.land/r/profile/integration0_test.gno | 3 +++ examples/gno.land/r/profile/profile.gno | 4 ++++ examples/gno.land/r/profile/profiles.gno | 1 + 3 files changed, 8 insertions(+) diff --git a/examples/gno.land/r/profile/integration0_test.gno b/examples/gno.land/r/profile/integration0_test.gno index a42682fb15b..a1af5c47292 100644 --- a/examples/gno.land/r/profile/integration0_test.gno +++ b/examples/gno.land/r/profile/integration0_test.gno @@ -8,6 +8,9 @@ import ( func main() { fmt.Println("test") + // various data types + // avatar + // ip address } // Output: diff --git a/examples/gno.land/r/profile/profile.gno b/examples/gno.land/r/profile/profile.gno index 7702377b487..fc2374fc847 100644 --- a/examples/gno.land/r/profile/profile.gno +++ b/examples/gno.land/r/profile/profile.gno @@ -6,6 +6,8 @@ import ( "gno.land/r/users" ) +// FIXME: manage privacy? + func newProfile(addr std.Address) *Profile { now := std.GetTime() return &Profile{ @@ -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") } diff --git a/examples/gno.land/r/profile/profiles.gno b/examples/gno.land/r/profile/profiles.gno index 89d929f38d9..d0a218607c2 100644 --- a/examples/gno.land/r/profile/profiles.gno +++ b/examples/gno.land/r/profile/profiles.gno @@ -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)