Skip to content

Commit 8e4356d

Browse files
committed
Use the same instance on the proxy and v3/impl realms
Signed-off-by: Antonio Navarro Perez <[email protected]>
1 parent 7e42e1a commit 8e4356d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Diff for: examples/gno.land/r/gov/dao/v3/impl/impl.gno

+8
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,11 @@ func AddMember(addr std.Address) {
4545
panic(err.Error())
4646
}
4747
}
48+
49+
func GetInstance() *GovDAO {
50+
if std.PreviousRealm().PkgPath() != "gno.land/r/gov/dao/v3/loader" {
51+
panic("not allowed")
52+
}
53+
54+
return govDAO
55+
}

Diff for: examples/gno.land/r/gov/dao/v3/loader/loader.gno

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
// this is only executed when loaded into genesis
99
func init() {
1010
dao.UpdateImpl(dao.UpdateRequest{
11-
DAO: impl.NewGovDAO(),
11+
DAO: impl.GetInstance(),
1212
AllowedDAOs: []string{"gno.land/r/gov/dao/v3/impl"},
1313
})
1414
}

0 commit comments

Comments
 (0)