Skip to content

Commit

Permalink
chore: move tendermint2 pkgs into tendermint2/pkgs
Browse files Browse the repository at this point in the history
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
  • Loading branch information
moul committed Mar 28, 2023
1 parent bb58088 commit a8d28ce
Show file tree
Hide file tree
Showing 2,259 changed files with 2,001 additions and 1,852 deletions.
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ This license is subject to change at any time by the Project owner. Your
continued access to or use of this Project or any works available through this
Project shall be subject to the then-current version of this license.

This license applies to github.com/gnolang/gno/pkgs/gnolang and all code except
the other common libraries under github.com/gnolang/gno/pkgs/ which are
This license applies to github.com/gnolang/gno/t2/pkg/gnolang and all code except
the other common libraries under github.com/gnolang/gno/t2/pkg/ which are
published under the Apache2.0 license.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ examples.build: install_gnodev examples.precompile
.PHONY: fmt
fmt:
go run -modfile ./misc/devdeps/go.mod mvdan.cc/gofumpt -w .
go run -modfile ./misc/devdeps/go.mod mvdan.cc/gofumpt -w `find stdlibs examples -name "*.gno"`
go run -modfile ./misc/devdeps/go.mod mvdan.cc/gofumpt -w `find gnovm/pkg/stdlibs examples -name "*.gno"`

.PHONY: lint
lint:
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,23 @@ See [./cmd/gnodev](./cmd/gnodev#readme) for instructions.
* Gnoland: https://gno.land/r/demo/boards:testboard
* Telegram: https://t.me/gnoland
* Twitter: https://twitter.com/_gnoland

<details><summary>Short doc about all the commands</summary>

_Note: please keep in sync with Makefile for now._

User commands:

* gnokey - key manipulation, also general interaction with gnoland
* gnoland - runs the blockchain node
* gnotxport - importing/exporting transactions from local blockchain node storage
* website - serves gno website, along with user-defined content
* logos - intended to be used as a browser

Developer commands:

* goscan - dumps imports from specified file’s AST
* genproto - helper for generating .proto implementations
* gnofaucet - serves GNOT faucet
* gnodev - handy tool for developing gno packages & realms
</details>
16 changes: 0 additions & 16 deletions cmd/README

This file was deleted.

14 changes: 7 additions & 7 deletions examples/gno.land/r/demo/groups/group.gno
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package groups

import (
"gno.land/p/demo/avl"
"std"
"strconv"
"time"

"gno.land/p/demo/avl"
)

type GroupID uint64
type GroupID uint64

func (gid GroupID) String() string {
return strconv.Itoa(int(gid))
Expand Down Expand Up @@ -54,10 +55,10 @@ func (group *Group) newMember(id MemberID, address std.Address, weight int, meta
}

func (group *Group) HasPermission(addr std.Address, perm Permission) bool {
if group.creator != addr {
return false
}
return isValidPermission(perm)
if group.creator != addr {
return false
}
return isValidPermission(perm)
}

func (group *Group) RenderGroup() string {
Expand All @@ -83,7 +84,6 @@ func (group *Group) deleteGroup() {
panic("group does not exist with id " + group.id.String())
}
gGroupsByName.Remove(group.name)

}

func (group *Group) deleteMember(mid MemberID) {
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/groups/member.gno
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ func (member *Member) getMemberStr() string {
memberDataStr := ""
memberDataStr += "\t\t\t[" + memberIDKey(member.id) + ", " + member.address.String() + ", " + strconv.Itoa(member.weight) + ", " + member.metadata + ", " + member.createdAt.String() + "],\n\n"
return memberDataStr
}
}
15 changes: 7 additions & 8 deletions examples/gno.land/r/demo/groups/misc.gno
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"std"
"strconv"
"strings"

"gno.land/r/demo/users"
)

Expand All @@ -15,7 +16,7 @@ func getGroup(gid GroupID) *Group {
gidkey := groupIDKey(gid)
group_, exists := gGroups.Get(gidkey)
if !exists {
panic("group id ("+gid.String()+") does not exists")
panic("group id (" + gid.String() + ") does not exists")
}
group := group_.(*Group)
return group
Expand All @@ -29,17 +30,16 @@ func incGetGroupID() GroupID {
func padLeft(str string, length int) string {
if len(str) >= length {
return str
}
}
return strings.Repeat(" ", length-len(str)) + str
}

func padZero(u64 uint64, length int) string {
str := strconv.Itoa(int(u64))
if len(str) >= length {
return str
}
}
return strings.Repeat("0", length-len(str)) + str

}

func groupIDKey(gid GroupID) string {
Expand Down Expand Up @@ -79,19 +79,18 @@ func displayAddressMD(addr std.Address) string {
user := users.GetUserByAddress(addr)
if user == nil {
return "[" + addr.String() + "](/r/users:" + addr.String() + ")"
}
}
return "[@" + user.Name() + "](/r/users:" + user.Name() + ")"
}

func usernameOf(addr std.Address) string {
user := users.GetUserByAddress(addr)
if user == nil {
panic("user not found")
}
}
return user.Name()

}

func isValidPermission(perm Permission) bool {
return perm == EditPermission || perm == DeletePermission
}
}
1 change: 0 additions & 1 deletion examples/gno.land/r/demo/groups/z_1_a_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ var gid groups.GroupID
const admin = std.Address("g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj")

func main() {

caller := std.GetOrigCaller() // main
users.Register("", "gnouser0", "my profile 1")

Expand Down
1 change: 0 additions & 1 deletion examples/gno.land/r/demo/groups/z_2_a_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ var gid groups.GroupID
const admin = std.Address("g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj")

func main() {

caller := std.GetOrigCaller() // main
users.Register("", "gnouser0", "my profile 1")

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion cmd/gnofaucet/main.go → gno.land/cmd/gnofaucet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"os"

"github.com/gnolang/gno/pkgs/commands"
"github.com/gnolang/gno/t2/pkg/commands"
)

func main() {
Expand Down
20 changes: 10 additions & 10 deletions cmd/gnofaucet/serve.go → gno.land/cmd/gnofaucet/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ import (
"strings"
"time"

"github.com/gnolang/gno/gnoland"
"github.com/gnolang/gno/pkgs/amino"
rpcclient "github.com/gnolang/gno/pkgs/bft/rpc/client"
"github.com/gnolang/gno/pkgs/commands"
"github.com/gnolang/gno/pkgs/crypto"
"github.com/gnolang/gno/pkgs/crypto/keys"
"github.com/gnolang/gno/pkgs/crypto/keys/client"
"github.com/gnolang/gno/pkgs/errors"
"github.com/gnolang/gno/pkgs/sdk/bank"
"github.com/gnolang/gno/pkgs/std"
"github.com/gnolang/gno/gno.land/pkg/gnoland"
"github.com/gnolang/gno/t2/pkg/amino"
rpcclient "github.com/gnolang/gno/t2/pkg/bft/rpc/client"
"github.com/gnolang/gno/t2/pkg/commands"
"github.com/gnolang/gno/t2/pkg/crypto"
"github.com/gnolang/gno/t2/pkg/crypto/keys"
"github.com/gnolang/gno/t2/pkg/crypto/keys/client"
"github.com/gnolang/gno/t2/pkg/errors"
"github.com/gnolang/gno/t2/pkg/sdk/bank"
"github.com/gnolang/gno/t2/pkg/std"
)

// url & struct for verify captcha
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"net"
"time"

"github.com/gnolang/gno/pkgs/service"
"github.com/gnolang/gno/t2/pkg/service"
)

type SubnetThrottler struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/gnokey/main.go → gno.land/cmd/gnokey/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"os"

"github.com/gnolang/gno/pkgs/crypto/keys/client"
"github.com/gnolang/gno/t2/pkg/crypto/keys/client"
)

func main() {
Expand Down
28 changes: 14 additions & 14 deletions cmd/gnoland/main.go → gno.land/cmd/gnoland/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ import (
"strings"
"time"

"github.com/gnolang/gno/gnoland"
"github.com/gnolang/gno/pkgs/amino"
abci "github.com/gnolang/gno/pkgs/bft/abci/types"
"github.com/gnolang/gno/pkgs/bft/config"
"github.com/gnolang/gno/pkgs/bft/node"
"github.com/gnolang/gno/pkgs/bft/privval"
bft "github.com/gnolang/gno/pkgs/bft/types"
"github.com/gnolang/gno/pkgs/commands"
"github.com/gnolang/gno/pkgs/crypto"
gno "github.com/gnolang/gno/pkgs/gnolang"
"github.com/gnolang/gno/pkgs/log"
osm "github.com/gnolang/gno/pkgs/os"
vmm "github.com/gnolang/gno/pkgs/sdk/vm"
"github.com/gnolang/gno/pkgs/std"
"github.com/gnolang/gno/gno.land/pkg/gnoland"
gno "github.com/gnolang/gno/gnovm/pkg/gnolang"
"github.com/gnolang/gno/t2/pkg/amino"
abci "github.com/gnolang/gno/t2/pkg/bft/abci/types"
"github.com/gnolang/gno/t2/pkg/bft/config"
"github.com/gnolang/gno/t2/pkg/bft/node"
"github.com/gnolang/gno/t2/pkg/bft/privval"
bft "github.com/gnolang/gno/t2/pkg/bft/types"
"github.com/gnolang/gno/t2/pkg/commands"
"github.com/gnolang/gno/t2/pkg/crypto"
"github.com/gnolang/gno/t2/pkg/log"
osm "github.com/gnolang/gno/t2/pkg/os"
vmm "github.com/gnolang/gno/t2/pkg/sdk/vm"
"github.com/gnolang/gno/t2/pkg/std"
)

type gnolandCfg struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"strings"
"testing"

"github.com/gnolang/gno/pkgs/commands"
"github.com/gnolang/gno/pkgs/testutils"
"github.com/gnolang/gno/t2/pkg/commands"
"github.com/gnolang/gno/t2/pkg/testutils"
"github.com/stretchr/testify/require"
)

Expand Down
File renamed without changes.
16 changes: 8 additions & 8 deletions gnoland/website/main.go → gno.land/cmd/gnoweb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ import (
"strings"
"time"

"github.com/gnolang/gno/pkgs/amino"
abci "github.com/gnolang/gno/pkgs/bft/abci/types"
"github.com/gnolang/gno/pkgs/bft/rpc/client"
osm "github.com/gnolang/gno/pkgs/os"
"github.com/gnolang/gno/pkgs/std"
"github.com/gnolang/gno/t2/pkg/amino"
abci "github.com/gnolang/gno/t2/pkg/bft/abci/types"
"github.com/gnolang/gno/t2/pkg/bft/rpc/client"
osm "github.com/gnolang/gno/t2/pkg/os"
"github.com/gnolang/gno/t2/pkg/std"
"github.com/gorilla/mux"
"github.com/gotuna/gotuna"

"github.com/gnolang/gno/gnoland/website/static" // for static files
"github.com/gnolang/gno/pkgs/sdk/vm" // for error types
// "github.com/gnolang/gno/pkgs/sdk" // for baseapp (info, status)
"github.com/gnolang/gno/gno.land/cmd/gnoweb/static" // for static files
"github.com/gnolang/gno/t2/pkg/sdk/vm" // for error types
// "github.com/gnolang/gno/t2/pkg/sdk" // for baseapp (info, status)
)

const (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 13 additions & 13 deletions gnoland/app.go → gno.land/pkg/gnoland/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import (
"path/filepath"
"strings"

"github.com/gnolang/gno/pkgs/amino"
abci "github.com/gnolang/gno/pkgs/bft/abci/types"
"github.com/gnolang/gno/pkgs/crypto"
dbm "github.com/gnolang/gno/pkgs/db"
"github.com/gnolang/gno/pkgs/log"
"github.com/gnolang/gno/pkgs/sdk"
"github.com/gnolang/gno/pkgs/sdk/auth"
"github.com/gnolang/gno/pkgs/sdk/bank"
"github.com/gnolang/gno/pkgs/sdk/vm"
"github.com/gnolang/gno/pkgs/std"
"github.com/gnolang/gno/pkgs/store"
"github.com/gnolang/gno/pkgs/store/dbadapter"
"github.com/gnolang/gno/pkgs/store/iavl"
"github.com/gnolang/gno/t2/pkg/amino"
abci "github.com/gnolang/gno/t2/pkg/bft/abci/types"
"github.com/gnolang/gno/t2/pkg/crypto"
dbm "github.com/gnolang/gno/t2/pkg/db"
"github.com/gnolang/gno/t2/pkg/log"
"github.com/gnolang/gno/t2/pkg/sdk"
"github.com/gnolang/gno/t2/pkg/sdk/auth"
"github.com/gnolang/gno/t2/pkg/sdk/bank"
"github.com/gnolang/gno/t2/pkg/sdk/vm"
"github.com/gnolang/gno/t2/pkg/std"
"github.com/gnolang/gno/t2/pkg/store"
"github.com/gnolang/gno/t2/pkg/store/dbadapter"
"github.com/gnolang/gno/t2/pkg/store/iavl"
)

// NewApp creates the GnoLand application.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion gnoland/package.go → gno.land/pkg/gnoland/package.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gnoland

import (
"github.com/gnolang/gno/pkgs/amino"
"github.com/gnolang/gno/t2/pkg/amino"
)

var Package = amino.RegisterPackage(amino.NewPackage(
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion gnoland/types.go → gno.land/pkg/gnoland/types.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gnoland

import (
"github.com/gnolang/gno/pkgs/std"
"github.com/gnolang/gno/t2/pkg/std"
)

type GnoAccount struct {
Expand Down
File renamed without changes.
Loading

0 comments on commit a8d28ce

Please sign in to comment.