Skip to content

Commit

Permalink
fix: minor fixes
Browse files Browse the repository at this point in the history
Signed-off-by: gfanton <[email protected]>
  • Loading branch information
gfanton committed Mar 18, 2024
1 parent f7897e2 commit d8e547d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions gno.land/pkg/sdk/vm/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,15 @@ func (vm *VMKeeper) Call(ctx sdk.Context, msg MsgCall) (res string, err error) {
for i, arg := range msg.Args {
pt := ft.Params[i].Type
arg = strings.TrimSpace(arg)
if len(arg) > 2 &&

// XXX: move this to `convertArgToGno` method ?
if len(arg) >= 2 &&
((arg[0] == '{' && arg[len(arg)-1] == '}') ||
(arg[0] == '[' && arg[len(arg)-1] == ']')) {
// Handle JSON argument
request[i], err = UnmarshalJSON(store.GetAllocator(), store, []byte(arg), pt)
if err != nil {
return "", fmt.Errorf("unable to unmarshal arg#%d: %w", err)
return "", fmt.Errorf("unable to unmarshal arg#%d: %w", i, err)
}

continue
Expand Down Expand Up @@ -321,7 +323,7 @@ func (vm *VMKeeper) Call(ctx sdk.Context, msg MsgCall) (res string, err error) {
var sv gno.StructValue
var st gno.StructType

// Generate result Typed Valye
// Generate result Typed Value
result := gno.TypedValue{
V: &gno.ArrayValue{
List: rtvs,
Expand Down
2 changes: 1 addition & 1 deletion gnovm/pkg/gnolang/gonative.go
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ func gno2GoValue(tv *TypedValue, rv reflect.Value) (ret reflect.Value) {
}

// Skip unexported field
if rt.Field(i).PkgPath != "" {
if !rt.Field(i).IsExported() {
continue
}

Expand Down

0 comments on commit d8e547d

Please sign in to comment.