Skip to content

Commit

Permalink
fix(examples): forms updates relative to gnolang#1475
Browse files Browse the repository at this point in the history
  • Loading branch information
agherasie committed Mar 1, 2025
1 parent 31d17c4 commit 00ec537
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/gno.land/p/agherasie/forms/create.gno
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (db *FormDB) CreateForm(title string, description string, openAt string, cl
// Creating the form
form := Form{
ID: id,
Owner: std.PrevRealm().Addr(),
Owner: std.PreviousRealm().Address(),
Title: title,
Description: description,
CreatedAt: time.Now(),
Expand Down
4 changes: 2 additions & 2 deletions examples/gno.land/p/agherasie/forms/submit.gno
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func (db *FormDB) SubmitForm(formID string, answers string) {
}

// Check if form was already submitted by this user
previousAnswer, err := db.GetAnswer(formID, std.PrevRealm().Addr())
previousAnswer, err := db.GetAnswer(formID, std.PreviousRealm().Address())
if previousAnswer != nil {
panic(errAlreadySubmitted)
}
Expand All @@ -33,7 +33,7 @@ func (db *FormDB) SubmitForm(formID string, answers string) {
answer := Submission{
FormID: formID,
Answers: answers,
Author: std.PrevRealm().Addr(),
Author: std.PreviousRealm().Address(),
SubmittedAt: time.Now(),
}
db.Answers = append(db.Answers, &answer)
Expand Down
1 change: 1 addition & 0 deletions examples/gno.land/r/agherasie/forms/forms.gno
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
var db *forms.FormDB

func init() {
hof.Register()
db = forms.NewDB()
}

Expand Down

0 comments on commit 00ec537

Please sign in to comment.