Skip to content

Make MsgCall error more descriptive in case of crossing #4432

@leohhhn

Description

@leohhhn

Description

All funcs meant to be called directly with MsgCall must be crossing. This means:

  1. Exported but non crossing funcs should always be called with a qeval; ie getters
  2. If a func is called with MsgCall but it does not have the first argument of type realm, the response error message to the user should be along the lines of {funcName} cannot be called with MsgCall (/directly). It can either be called with qeval, or via another code realm.

Currently, the keeper spews an error that doesn't make sense to the end-user.

gnokey maketx call -pkgpath "gno.land/r/demo/emit" -func "Emit" -args "" -gas-fee 100000
0ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "staging" -remote "https://rpc.gno
.land:443" main

TX HASH:
INFO:
--= Error =--
Data: internal error
Msg Traces:
    0  /Users/sasurai/Desktop/gno/gno/tm2/pkg/errors/errors.go:28 - deliver transaction failed: log:recovered: wrong number of arguments in call to Emit: want 1 got 2

Metadata

Metadata

Labels

Type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions