-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP]feat: vm result, error handling #718
Conversation
// in FunctionSignature{}. | ||
// String representation of arg must be deterministic. | ||
// NOTE: very important that there is no malleability. | ||
func ConvertArgToGno(arg string, argT Type) (tv TypedValue) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this copied from anywhere?
expr := fmt.Sprintf(`pkg.%s(%s)`, fnc, argslist) | ||
xn := gno.MustParseExpr(expr) | ||
func (vm *VMKeeper) Call(ctx sdk.Context, msg MsgCall) sdk.Result { | ||
w := NewWrapper(msg, vm.getGnoStore(ctx)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a better name.
"Wrapper" is used for things like "CacheWrapper", which actually wraps a singular thing and keeps the method signature the same. In that sense this isn't a "wrapper".
if rt.Kind() == reflect.Struct { // struct kind | ||
var result VMResult | ||
vrf := reflect.ValueOf(&result).Elem() | ||
gno.Gno2GoValue(rtvs[0].V.(gno.PointerValue).TV, vrf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why we would want to do this.
Gno2GoValue usage should be restricted, as native values have severe limitations; but here it looks like it is trying to be the default.
I believe we should at the most use a single method to stringify the result of a tx and include the result in the blockchain, but otherwise not depend on it for anything.
If we wanted to pass the result of one tx as args into another, we should be able to express it as two lines of code that get executed. We should not rely on stringification or reflection/native intermediaries to get that job done.
close for invalid assumption. |
No description provided.