diff --git a/gno.land/pkg/keyscli/call.go b/gno.land/pkg/keyscli/call.go index db81246749d..7eb5be7d501 100644 --- a/gno.land/pkg/keyscli/call.go +++ b/gno.land/pkg/keyscli/call.go @@ -74,12 +74,6 @@ func execMakeCall(cfg *MakeCallCfg, args []string, io commands.IO) error { if cfg.PkgPath == "" { return errors.New("pkgpath not specified") } - if len(cfg.PkgPath) < 10 || cfg.PkgPath[:9] != "gno.land/" { - return errors.New("pkgpath should starts with gno.land/") - } - if len(cfg.PkgPath) >= 10 && (cfg.PkgPath[:10] == "gno.land/p" || cfg.PkgPath[:11] == "gno.land/p/") { - return errors.New("called to /p is forbidden") - } if cfg.FuncName == "" { return errors.New("func not specified") } diff --git a/gno.land/pkg/sdk/vm/keeper.go b/gno.land/pkg/sdk/vm/keeper.go index a77ddac3e28..2372a89125c 100644 --- a/gno.land/pkg/sdk/vm/keeper.go +++ b/gno.land/pkg/sdk/vm/keeper.go @@ -237,6 +237,9 @@ func (vm *VMKeeper) AddPackage(ctx sdk.Context, msg MsgAddPackage) (err error) { // Call calls a public Gno function (for delivertx). func (vm *VMKeeper) Call(ctx sdk.Context, msg MsgCall) (res string, err error) { pkgPath := msg.PkgPath // to import + if !gno.IsRealmPath(pkgPath) { + return "", errors.New("pkgpath must be a realm") + } fnc := msg.Func gnostore := vm.getGnoStore(ctx) // Get the package and function type.