-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Implement ots_getInternalOperations
#7332
Conversation
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.
amazing,
pedantic nit re dependency
crates/rpc/rpc-types/Cargo.toml
Outdated
@@ -21,6 +21,7 @@ alloy-rpc-engine-types = { workspace = true, features = ["jsonrpsee-types"] } | |||
ethereum_ssz_derive = { version = "0.5", optional = true } | |||
ethereum_ssz = { version = "0.5", optional = true } | |||
alloy-genesis.workspace = true | |||
revm-inspectors.workspace = true |
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.
I don't want the dep here we can convert this in the request impl, because we only really need it there
and eventually we will move the otterscan types to alloy and then can do the conversion natively in revm-inspectors
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.
Done.
crates/rpc/rpc/src/otterscan.rs
Outdated
) | ||
.await? | ||
.map(|transfer_operations| transfer_operations.into_iter().map(Into::into).collect()) | ||
.ok_or_else(|| internal_rpc_err("failed to inspect transaction")) |
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.
this is not required, can use ?
here I believe
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.
I can't use ?
on Option<Vec<InternalOperation>
to get Result<Vec<InternalOperation>, Err>
, so I use unwrap_or_default
to the inside content and return with Ok
crates/rpc/rpc/src/otterscan.rs
Outdated
|_tx_info, inspector, _, _| Ok(inspector.into_transfers()), | ||
) | ||
.await? | ||
.map(|transfer_operations| transfer_operations.into_iter().map(Into::into).collect()) |
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.
let's move the conversion in here
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.
Done
close #7310