mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix: no value for staticcall call traces (#5117)
This commit is contained in:
@ -32,14 +32,22 @@ pub enum CallKind {
|
|||||||
|
|
||||||
impl CallKind {
|
impl CallKind {
|
||||||
/// Returns true if the call is a create
|
/// Returns true if the call is a create
|
||||||
|
#[inline]
|
||||||
pub fn is_any_create(&self) -> bool {
|
pub fn is_any_create(&self) -> bool {
|
||||||
matches!(self, CallKind::Create | CallKind::Create2)
|
matches!(self, CallKind::Create | CallKind::Create2)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns true if the call is a delegate of some sorts
|
/// Returns true if the call is a delegate of some sorts
|
||||||
|
#[inline]
|
||||||
pub fn is_delegate(&self) -> bool {
|
pub fn is_delegate(&self) -> bool {
|
||||||
matches!(self, CallKind::DelegateCall | CallKind::CallCode)
|
matches!(self, CallKind::DelegateCall | CallKind::CallCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns true if the call is [CallKind::StaticCall].
|
||||||
|
#[inline]
|
||||||
|
pub fn is_static_call(&self) -> bool {
|
||||||
|
matches!(self, CallKind::StaticCall)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::fmt::Display for CallKind {
|
impl std::fmt::Display for CallKind {
|
||||||
@ -413,6 +421,11 @@ impl CallTraceNode {
|
|||||||
logs: Default::default(),
|
logs: Default::default(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if self.trace.kind.is_static_call() {
|
||||||
|
// STATICCALL frames don't have a value
|
||||||
|
call_frame.value = None;
|
||||||
|
}
|
||||||
|
|
||||||
// we need to populate error and revert reason
|
// we need to populate error and revert reason
|
||||||
if !self.trace.success {
|
if !self.trace.success {
|
||||||
call_frame.revert_reason = decode_revert_reason(self.trace.output.as_ref());
|
call_frame.revert_reason = decode_revert_reason(self.trace.output.as_ref());
|
||||||
|
|||||||
Reference in New Issue
Block a user