Skip to content

Commit 871a4e0

Browse files
fix: ErrExecutionReverted JSONRPCError conversion error with Lotus Gateway (#6551)
1 parent 2d81b07 commit 871a4e0

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737

3838
### Fixed
3939

40+
- [#6551](https://github.com/ChainSafe/forest/pull/6551): Fixed `ErrExecutionReverted` JSONRPCError conversion error with Lotus Gateway.
41+
4042
## Forest v0.32.0 "Ember"
4143

4244
This is a non-mandatory release for all node operators. It resets F3 on calibnet, also includes new V2 RPC methods, a few bug fixes and `lotus-gateway` compatibility fixes.

src/rpc/methods/eth/errors.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ pub const EXECUTION_REVERTED_CODE: i32 = 3;
1414
#[derive(Clone, Debug, Error, Serialize)]
1515
pub enum EthErrors {
1616
#[error("{message}")]
17-
ExecutionReverted {
18-
message: String,
19-
data: Option<String>,
20-
},
17+
ExecutionReverted { message: String, data: String },
2118
}
2219

2320
impl EthErrors {
@@ -33,7 +30,7 @@ impl EthErrors {
3330
message: format!(
3431
"message execution failed (exit=[{exit_code}]{revert_reason}, vm error=[{error}])"
3532
),
36-
data: (!data.is_empty()).then(|| format!("0x{}", hex::encode(data))),
33+
data: format!("0x{}", hex::encode(data)),
3734
}
3835
}
3936
}
@@ -54,7 +51,7 @@ impl RpcErrorData for EthErrors {
5451
fn error_data(&self) -> Option<serde_json::Value> {
5552
match self {
5653
EthErrors::ExecutionReverted { data, .. } => {
57-
data.clone().map(serde_json::Value::String)
54+
Some(serde_json::Value::String(data.clone()))
5855
}
5956
}
6057
}

0 commit comments

Comments
 (0)