Skip to content

Commit

Permalink
chore: move everything under teritori namespace
Browse files Browse the repository at this point in the history
Signed-off-by: Norman Meier <[email protected]>
  • Loading branch information
n0izn0iz committed Dec 17, 2024
1 parent af91c7f commit 2ca5706
Show file tree
Hide file tree
Showing 46 changed files with 131 additions and 131 deletions.
6 changes: 0 additions & 6 deletions examples/gno.land/p/demo/dao_maker/dao_core/gno.mod

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions examples/gno.land/p/demo/dao_maker/dao_utils/gno.mod

This file was deleted.

8 changes: 0 additions & 8 deletions examples/gno.land/p/demo/dao_maker/dao_voting_group/gno.mod

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"
"strings"

dao_interfaces "gno.land/p/demo/dao_maker/dao_interfaces"
dao_interfaces "gno.land/p/teritori/dao_interfaces"
)

// TODO: add wrapper message handler to handle multiple proposal modules messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"std"
"testing"

dao_interfaces "gno.land/p/demo/dao_maker/dao_interfaces"
dao_interfaces "gno.land/p/teritori/dao_interfaces"
)

type votingModule struct {
Expand Down
6 changes: 6 additions & 0 deletions examples/gno.land/p/teritori/dao_core/gno.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module gno.land/p/teritori/dao_core

require (
gno.land/p/teritori/dao_interfaces v0.0.0-latest
gno.land/p/demo/json v0.0.0-latest
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package core

import (
dao_interfaces "gno.land/p/demo/dao_maker/dao_interfaces"
dao_interfaces "gno.land/p/teritori/dao_interfaces"
"gno.land/p/demo/json"
)

Expand All @@ -15,7 +15,7 @@ type UpdateProposalModulesExecutableMessage struct {
var _ dao_interfaces.ExecutableMessage = &UpdateProposalModulesExecutableMessage{}

func (msg UpdateProposalModulesExecutableMessage) Type() string {
return "gno.land/p/demo/dao_maker/dao_core.UpdateProposalModules"
return "gno.land/p/teritori/dao_core.UpdateProposalModules"
}

func (msg *UpdateProposalModulesExecutableMessage) String() string {
Expand Down Expand Up @@ -62,7 +62,7 @@ type UpdateVotingModuleExecutableMessage struct {
var _ dao_interfaces.ExecutableMessage = &UpdateVotingModuleExecutableMessage{}

func (msg UpdateVotingModuleExecutableMessage) Type() string {
return "gno.land/p/demo/dao_maker/dao_core.UpdateVotingModule"
return "gno.land/p/teritori/dao_core.UpdateVotingModule"
}

func (msg *UpdateVotingModuleExecutableMessage) String() string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ type IDAOCore interface {
}
```

A default implementation is provided in the package `gno.land/p/demo/dao_maker/dao_core`, and custom implementations are generally not required.
A default implementation is provided in the package `gno.land/p/teritori/dao_core`, and custom implementations are generally not required.

### Voting Module

The `gno.land/p/demo/dao_maker/dao_interfaces.IVotingModule` interface defines how voting power is allocated to addresses within the DAO.
The `gno.land/p/teritori/dao_interfaces.IVotingModule` interface defines how voting power is allocated to addresses within the DAO.

**Interface Definition:**

Expand All @@ -56,11 +56,11 @@ type IVotingModule interface {
}
```

There is only one implementation currently, `gno.land/p/demo/dao_maker/dao_voting_group`, providing a membership-based voting power definition.
There is only one implementation currently, `gno.land/p/teritori/dao_voting_group`, providing a membership-based voting power definition.

### Proposal Modules

A proposal module (`gno.land/p/demo/dao_maker/dao_interfaces.IProposalModule`) is responsible for:
A proposal module (`gno.land/p/teritori/dao_interfaces.IProposalModule`) is responsible for:
- Receiving proposals, the proposal type is defined by the module
- Managing the proposals lifecycle
- Tallying votes, the vote type is defined by the module and the associated voting power is queried from the voting module
Expand All @@ -81,11 +81,11 @@ type IProposalModule interface {
}
```

There is only one implementation currently, `gno.land/p/demo/dao_maker/dao_proposal_single`, providing a yes/no/abstain vote model with quorum and threshold.
There is only one implementation currently, `gno.land/p/teritori/dao_proposal_single`, providing a yes/no/abstain vote model with quorum and threshold.

### Message handlers

Proposal actions are encoded as objects implementing `ExecutableMessage` found under `gno.land/p/demo/dao_maker/dao_interfaces`.
Proposal actions are encoded as objects implementing `ExecutableMessage` found under `gno.land/p/teritori/dao_interfaces`.
```go
type ExecutableMessage interface {
ToJSON() *json.Node
Expand All @@ -96,7 +96,7 @@ type ExecutableMessage interface {
}
```

They are unmarshalled and executed by message handlers implementing `gno.land/p/demo/dao_maker/dao_interfaces.MessageHandler`.
They are unmarshalled and executed by message handlers implementing `gno.land/p/teritori/dao_interfaces.MessageHandler`.
```go
type MessageHandler interface {
Execute(message ExecutableMessage)
Expand Down Expand Up @@ -134,7 +134,7 @@ Modules instantiation uses the factory pattern in case the module needs to acces
package my_dao

import (
"gno.land/p/demo/dao_maker/dao_interfaces"
"gno.land/p/teritori/dao_interfaces"
)

func init() {
Expand All @@ -151,8 +151,8 @@ func init() {
package my_dao

import (
"gno.land/p/demo/dao_maker/dao_interfaces"
"gno.land/p/demo/dao_maker/dao_voting_group" // <- new
"gno.land/p/teritori/dao_interfaces"
"gno.land/p/teritori/dao_voting_group" // <- new
)

func init() {
Expand Down Expand Up @@ -207,9 +207,9 @@ func init() {
package my_dao

import (
"gno.land/p/demo/dao_maker/dao_interfaces"
"gno.land/p/demo/dao_maker/dao_voting_group"
"gno.land/p/demo/dao_maker/dao_proposal_single" // <- new
"gno.land/p/teritori/dao_interfaces"
"gno.land/p/teritori/dao_voting_group"
"gno.land/p/teritori/dao_proposal_single" // <- new
)

func init() {
Expand Down Expand Up @@ -243,9 +243,9 @@ Add message handlers to allow your DAO to perform specific actions when proposal
package my_dao

import (
"gno.land/p/demo/dao_maker/dao_interfaces"
"gno.land/p/demo/dao_maker/dao_voting_group"
"gno.land/p/demo/dao_maker/dao_proposal_single"
"gno.land/p/teritori/dao_interfaces"
"gno.land/p/teritori/dao_voting_group"
"gno.land/p/teritori/dao_proposal_single"
)

func init() {
Expand All @@ -271,10 +271,10 @@ Now we can create the actual DAO.
package my_dao

import (
"gno.land/p/demo/dao_maker/dao_interfaces"
"gno.land/p/demo/dao_maker/dao_voting_group"
"gno.land/p/demo/dao_maker/dao_proposal_single"
"gno.land/p/demo/dao_maker/dao_core" // <- new
"gno.land/p/teritori/dao_interfaces"
"gno.land/p/teritori/dao_voting_group"
"gno.land/p/teritori/dao_proposal_single"
"gno.land/p/teritori/dao_core" // <- new
)

var (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module gno.land/p/demo/dao_maker/dao_interfaces
module gno.land/p/teritori/dao_interfaces

require (
gno.land/p/demo/avl v0.0.0-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type RegisterHandlerExecutableMessage struct {
var _ ExecutableMessage = &RegisterHandlerExecutableMessage{}

func (m RegisterHandlerExecutableMessage) Type() string {
return "gno.land/p/demo/dao_maker/dao_interfaces.RegisterHandler"
return "gno.land/p/teritori/dao_interfaces.RegisterHandler"
}

func (m *RegisterHandlerExecutableMessage) FromJSON(ast *json.Node) {
Expand Down Expand Up @@ -122,7 +122,7 @@ type RemoveHandlerExecutableMessage struct {
var _ ExecutableMessage = &RemoveHandlerExecutableMessage{}

func (m RemoveHandlerExecutableMessage) Type() string {
return "gno.land/p/demo/dao_maker/dao_interfaces.RemoveHandler"
return "gno.land/p/teritori/dao_interfaces.RemoveHandler"
}

func (m *RemoveHandlerExecutableMessage) FromJSON(ast *json.Node) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"strings"

"gno.land/p/demo/avl"
"gno.land/p/demo/dao_maker/dao_interfaces"
"gno.land/p/demo/dao_maker/dao_utils"
"gno.land/p/teritori/dao_interfaces"
"gno.land/p/teritori/dao_utils"
"gno.land/p/demo/json"
)

Expand Down Expand Up @@ -244,7 +244,7 @@ func (d *DAOProposalSingle) Core() dao_interfaces.IDAOCore {

func (d *DAOProposalSingle) Info() dao_interfaces.ModuleInfo {
return dao_interfaces.ModuleInfo{
Kind: "gno.land/p/demo/dao_maker/dao_proposal_single",
Kind: "gno.land/p/teritori/dao_proposal_single",
Version: "0.1.0",
}
}
Expand Down
9 changes: 9 additions & 0 deletions examples/gno.land/p/teritori/dao_proposal_single/gno.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module gno.land/p/teritori/dao_proposal_single

require (
gno.land/p/demo/avl 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
gno.land/p/demo/json v0.0.0-latest
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"testing"

"gno.land/p/demo/avl"
dao_interfaces "gno.land/p/demo/dao_maker/dao_interfaces"
"gno.land/p/demo/dao_maker/dao_utils"
dao_interfaces "gno.land/p/teritori/dao_interfaces"
"gno.land/p/teritori/dao_utils"
"gno.land/p/demo/json"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strconv"
"strings"

"gno.land/p/demo/dao_maker/jsonutil"
"gno.land/p/teritori/jsonutil"
"gno.land/p/demo/json"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"strconv"

"gno.land/p/demo/avl"
dao_interfaces "gno.land/p/demo/dao_maker/dao_interfaces"
"gno.land/p/demo/dao_maker/dao_utils"
"gno.land/p/demo/dao_maker/jsonutil"
dao_interfaces "gno.land/p/teritori/dao_interfaces"
"gno.land/p/teritori/dao_utils"
"gno.land/p/teritori/jsonutil"
"gno.land/p/demo/json"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dao_proposal_single
import (
"strings"

"gno.land/p/demo/dao_maker/dao_interfaces"
"gno.land/p/teritori/dao_interfaces"
"gno.land/p/demo/json"
)

Expand All @@ -16,7 +16,7 @@ type UpdateSettingsMessage struct {
var _ dao_interfaces.ExecutableMessage = (*UpdateSettingsMessage)(nil)

func (usm UpdateSettingsMessage) Type() string {
return "gno.land/p/demo/dao_maker/dao_proposal_single.UpdateSettings"
return "gno.land/p/teritori/dao_proposal_single.UpdateSettings"
}

func (usm *UpdateSettingsMessage) String() string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"
"time"

"gno.land/p/demo/dao_maker/jsonutil"
"gno.land/p/teritori/jsonutil"
"gno.land/p/demo/json"
)

Expand Down
6 changes: 6 additions & 0 deletions examples/gno.land/p/teritori/dao_utils/gno.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module gno.land/p/teritori/dao_utils

require (
gno.land/p/teritori/jsonutil v0.0.0-latest
gno.land/p/demo/json v0.0.0-latest
)
8 changes: 8 additions & 0 deletions examples/gno.land/p/teritori/dao_voting_group/gno.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module gno.land/p/teritori/dao_voting_group

require (
gno.land/p/teritori/dao_interfaces v0.0.0-latest
gno.land/p/teritori/havl v0.0.0-latest
gno.land/p/teritori/jsonutil v0.0.0-latest
gno.land/p/demo/json v0.0.0-latest
)
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package dao_voting_group

import (
"gno.land/p/demo/dao_maker/dao_interfaces"
"gno.land/p/teritori/dao_interfaces"
"gno.land/p/demo/json"
)

const updateMembersType = "gno.land/p/demo/dao_maker/dao_voting_group.UpdateMembers"
const updateMembersType = "gno.land/p/teritori/dao_voting_group.UpdateMembers"

type UpdateMembersExecutableMessage []Member

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"strconv"
"strings"

dao_interfaces "gno.land/p/demo/dao_maker/dao_interfaces"
"gno.land/p/demo/dao_maker/havl"
"gno.land/p/demo/dao_maker/jsonutil"
dao_interfaces "gno.land/p/teritori/dao_interfaces"
"gno.land/p/teritori/havl"
"gno.land/p/teritori/jsonutil"
"gno.land/p/demo/json"
)

Expand Down Expand Up @@ -47,7 +47,7 @@ func NewVotingGroup() *VotingGroup {

func (v *VotingGroup) Info() dao_interfaces.ModuleInfo {
return dao_interfaces.ModuleInfo{
Kind: "gno.land/p/demo/dao_maker/dao_voting_group",
Kind: "gno.land/p/teritori/dao_voting_group",
Version: "0.1.0",
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dao_voting_group
import (
"testing"

dao_interfaces "gno.land/p/demo/dao_maker/dao_interfaces"
dao_interfaces "gno.land/p/teritori/dao_interfaces"
)

func TestVotingGroup(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module gno.land/p/demo/dao_maker/havl
module gno.land/p/teritori/havl

require gno.land/p/demo/avl v0.0.0-latest
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module gno.land/p/demo/dao_maker/jsonutil
module gno.land/p/teritori/jsonutil

require (
gno.land/p/demo/avl v0.0.0-latest
Expand Down
14 changes: 0 additions & 14 deletions examples/gno.land/r/demo/dao_maker/dao_realm/gno.mod

This file was deleted.

Loading

0 comments on commit 2ca5706

Please sign in to comment.