Skip to content

Commit

Permalink
fix comments on PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Villaquiranm committed Oct 22, 2024
1 parent 091a123 commit d5639e5
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 45 deletions.
8 changes: 0 additions & 8 deletions gnovm/pkg/gnolang/realm.go
Original file line number Diff line number Diff line change
Expand Up @@ -1532,14 +1532,6 @@ func isUnsaved(oo Object) bool {
return oo.GetIsNewReal() || oo.GetIsDirty()
}

// pkgPathPrefix is the prefix used to identify pkgpaths which are meant to
// be pure packages. This is used by [IsPkgPath].
const pkgPathPrefix = "gno.land/p/"

func IsPkgPath(pkgPath string) bool {
return strings.HasPrefix(pkgPath, pkgPathPrefix)
}

func prettyJSON(jstr []byte) []byte {
var c interface{}
err := json.Unmarshal(jstr, &c)
Expand Down
5 changes: 0 additions & 5 deletions gnovm/pkg/gnolang/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -837,11 +837,6 @@ func (pv *PackageValue) IsRealm() bool {
return IsRealmPath(pv.PkgPath)
}

// IsPkgPath returns true if pv represents a package path.
func (pv *PackageValue) IsPkgPath() bool {
return IsPkgPath(pv.PkgPath)
}

func (pv *PackageValue) getFBlocksMap() map[Name]*Block {
if pv.fBlocksMap == nil {
pv.fBlocksMap = make(map[Name]*Block, len(pv.FNames))
Expand Down
3 changes: 2 additions & 1 deletion gnovm/stdlibs/std/native.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package std

import (
"github.com/gnolang/gno/gnovm/pkg/gnolang"

Check failure on line 4 in gnovm/stdlibs/std/native.go

View workflow job for this annotation

GitHub Actions / Run Main / Go Linter / lint

ST1019: package "github.com/gnolang/gno/gnovm/pkg/gnolang" is being imported more than once (stylecheck)
gno "github.com/gnolang/gno/gnovm/pkg/gnolang"

Check failure on line 5 in gnovm/stdlibs/std/native.go

View workflow job for this annotation

GitHub Actions / Run Main / Go Linter / lint

ST1019(related information): other import of "github.com/gnolang/gno/gnovm/pkg/gnolang" (stylecheck)
"github.com/gnolang/gno/tm2/pkg/bech32"
"github.com/gnolang/gno/tm2/pkg/crypto"
Expand Down Expand Up @@ -160,7 +161,7 @@ func X_decodeBech32(addr string) (prefix string, bytes [20]byte, ok bool) {

func X_assertCallerIsRealm(m *gno.Machine) {
frame := m.Frames[m.NumFrames()-2]

Check warning on line 163 in gnovm/stdlibs/std/native.go

View check run for this annotation

Codecov / codecov/patch

gnovm/stdlibs/std/native.go#L162-L163

Added lines #L162 - L163 were not covered by tests
if frame.LastPackage.IsPkgPath() {
if path := frame.LastPackage.PkgPath; !gnolang.IsRealmPath(path) {
m.Panic(typedString("caller is not a realm"))
}

Check warning on line 166 in gnovm/stdlibs/std/native.go

View check run for this annotation

Codecov / codecov/patch

gnovm/stdlibs/std/native.go#L165-L166

Added lines #L165 - L166 were not covered by tests
}
Expand Down
30 changes: 0 additions & 30 deletions gnovm/tests/stdlibs/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion gnovm/tests/stdlibs/std/std.gno
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ func testSetOrigSend(
func testIssueCoins(addr string, denom []string, amt []int64)
func getRealm(height int) (address string, pkgPath string)
func isRealm(pkgPath string) bool

0 comments on commit d5639e5

Please sign in to comment.