gnolang / gno

Gno: An interpreted, stack-based Go virtual machine to build succinct and composable apps + Gno.land: a blockchain for timeless code and fair open-source.
https://gno.land/
Other
895 stars 372 forks source link

support variadic types as function args in MsgCall #1611

Open thehowl opened 8 months ago

thehowl commented 8 months ago

From discussion in #1610.

Running maxetx call on a variadic function (like the below) will panic claiming that the slice type is not supported.

I think it is reasonable to support variadic types if the underlying types can be easily parsed by the vm keeper.

package variadic

import "strings"

func Echo(vals ...string) string {
    return strings.Join(vals, " ")
}
moul commented 1 week ago

Removing the "must have" requirement since we have alternative ways to call this function. Additionally, it may be more challenging than anticipated because we also need to update the gnoweb help page, as well as possibly the JS and Go clients.