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
Out of gas handling #82
Conversation
63ad440
to
107ca11
Compare
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.
beautiful
Doesn't this resolve #73 as well? Or at least a big part of it? |
To a large extent, yeah, but not fully, yet. I can mark it as related since to get all the information across from the Go callback to the Go caller, it needs to basically be fixed as well. |
269fddf
to
2bfde32
Compare
GoResult::Panic => Err(make_ffi_foreign_panic()), | ||
GoResult::BadArgument => Err(make_ffi_bad_argument()), | ||
GoResult::OutOfGas => Err(make_ffi_out_of_gas()), | ||
GoResult::Other => Err(make_ffi_other("Unspecified error in Go code")), |
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.
okay, so this is the reason we need error mutability: we only get the i32 from Go.
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.
no and yes.
we get it from go, but we also create the FfiError in go-cosmwasm, so we can have a method on GoResult
that converts the GoResult
to an FfiError
, but also takes an Into<String>
which is only used if it's Other
Add labels to contract instances
This PR aims to fix #29 and fix #79.
It depends on CosmWasm/cosmwasm#331