You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most of them are pretty trivial, however, there are some return Capture, which seems to wrapping the error internally already. Do we make it Result<Capture<...>, ExitFatal> too?
Error type
The original proposal was to use the ExitFatal, but what if we do this instead:
pub trait Handler {
...
/// The runtime error.
type RuntimeError: From<ExitFatal> + Into<ExitFatal>;
...
/// Get balance of address.
fn balance(&self, address: H160) -> Result<U256, Self::RuntimeError>;
...
The idea is to have a user-provided type that has to be able to hold the ExitFatal (we don't require that specifically, just that we can go from and to ExitFatal). This might give some freedom to the implementors to introduce the errors that are internal within their implementation. Not sure if this is a good idea or not, or if it is a good implementation of the idea or not, but any feedback is welcome.
A follow-up from polkadot-evm/frontier#724 (comment).
This issue is to discuss the details of making the
Handler
(https://github.com/rust-blockchain/evm/blob/master/runtime/src/handler.rs) calls fallible.Non-trivial cases
Most of them are pretty trivial, however, there are some return
Capture
, which seems to wrapping the error internally already. Do we make itResult<Capture<...>, ExitFatal>
too?Error type
The original proposal was to use the
ExitFatal
, but what if we do this instead:The idea is to have a user-provided type that has to be able to hold the
ExitFatal
(we don't require that specifically, just that we can go from and toExitFatal
). This might give some freedom to the implementors to introduce the errors that are internal within their implementation. Not sure if this is a good idea or not, or if it is a good implementation of the idea or not, but any feedback is welcome.CC @dmitrylavrenov, @intendednull, @Henry-bee
The text was updated successfully, but these errors were encountered: