-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat-rakki-ui
- Loading branch information
Showing
90 changed files
with
1,657 additions
and
689 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
9786fa366f922f04e1251ec6f1df6423b4fd2bf4 | ||
c8cd8f4b6ccbe9f4ee5622032228553496186d51 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1 @@ | ||
module gno.land/p/teritori/dao_core | ||
|
||
require ( | ||
gno.land/p/demo/json v0.0.0-latest | ||
gno.land/p/teritori/dao_interfaces v0.0.0-latest | ||
gno.land/p/teritori/jsonutil v0.0.0-latest | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1 @@ | ||
module gno.land/p/teritori/dao_interfaces | ||
|
||
require ( | ||
gno.land/p/demo/avl v0.0.0-latest | ||
gno.land/p/demo/json v0.0.0-latest | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1 @@ | ||
module gno.land/p/teritori/dao_proposal_single | ||
|
||
require ( | ||
gno.land/p/demo/avl v0.0.0-latest | ||
gno.land/p/demo/json v0.0.0-latest | ||
gno.land/p/teritori/dao_interfaces v0.0.0-latest | ||
gno.land/p/teritori/dao_utils v0.0.0-latest | ||
gno.land/p/teritori/jsonutil v0.0.0-latest | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1 @@ | ||
module gno.land/p/teritori/dao_roles_group | ||
|
||
require ( | ||
gno.land/p/demo/json v0.0.0-latest | ||
gno.land/p/teritori/dao_interfaces v0.0.0-latest | ||
gno.land/p/teritori/jsonutil v0.0.0-latest | ||
gno.land/p/teritori/role_manager v0.0.0-latest | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module gno.land/p/teritori/dao_roles_voting_group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package dao_roles_voting_group | ||
|
||
import ( | ||
"gno.land/p/demo/json" | ||
"gno.land/p/teritori/dao_interfaces" | ||
) | ||
|
||
const updateMembersType = "gno.land/p/teritori/dao_voting_group.UpdateMembers" | ||
|
||
type UpdateMembersExecutableMessage []Member | ||
|
||
var _ dao_interfaces.ExecutableMessage = (*UpdateMembersExecutableMessage)(nil) | ||
|
||
func (m *UpdateMembersExecutableMessage) FromJSON(ast *json.Node) { | ||
changes := ast.MustArray() | ||
*m = make([]Member, len(changes)) | ||
for i, change := range changes { | ||
(*m)[i].FromJSON(change) | ||
} | ||
} | ||
|
||
func (m *UpdateMembersExecutableMessage) ToJSON() *json.Node { | ||
changes := make([]*json.Node, len(*m)) | ||
for i, change := range *m { | ||
changes[i] = change.ToJSON() | ||
} | ||
|
||
return json.ArrayNode("", changes) | ||
} | ||
|
||
func (m *UpdateMembersExecutableMessage) String() string { | ||
return m.ToJSON().String() | ||
} | ||
|
||
func (m *UpdateMembersExecutableMessage) Type() string { | ||
return updateMembersType | ||
} | ||
|
||
type updateMembersHandler struct { | ||
vg *RolesVotingGroup | ||
} | ||
|
||
var _ dao_interfaces.MessageHandler = (*updateMembersHandler)(nil) | ||
|
||
func (h *updateMembersHandler) Type() string { | ||
return updateMembersType | ||
} | ||
|
||
func (h *updateMembersHandler) Execute(msg dao_interfaces.ExecutableMessage) { | ||
m, ok := msg.(*UpdateMembersExecutableMessage) | ||
if !ok { | ||
panic("unexpected message type") | ||
} | ||
|
||
for _, change := range *m { | ||
h.vg.SetMemberPower(change.Address, change.Power) | ||
} | ||
} | ||
|
||
func (h *updateMembersHandler) Instantiate() dao_interfaces.ExecutableMessage { | ||
return &UpdateMembersExecutableMessage{} | ||
} |
Oops, something went wrong.