Update ApplyError to convert WasmSdkErrors to InvalidTransactions
Before, they would be converted into an InternalError. This
make wasm failures more safe, as it is hard to tell what is a
transient condition or will continue to happen on retry.
@@ -263,10 +263,9 @@ impl std::fmt::Display for ApplyError {
impl From<WasmSdkError> for ApplyError {
fn from(e: WasmSdkError) -> Self {
match e {
- WasmSdkError::InvalidTransaction(..) => {
- ApplyError::InvalidTransaction(format!("{}", e))
- }
- _ => ApplyError::InternalError(format!("{}", e)),
+ WasmSdkError::InternalError(..) =>
+ ApplyError::InternalError(format!("{}", e)),
+ _ => ApplyError::InvalidTransaction(format!("{}", e)),
}
}
}
