Skip to content
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

Merged
merged 4 commits into from
Mar 26, 2024
Merged

Conversation

AbnerZheng
Copy link
Contributor

close #7310

@AbnerZheng AbnerZheng closed this Mar 25, 2024
@AbnerZheng AbnerZheng deleted the issue-7310 branch March 25, 2024 18:33
@AbnerZheng AbnerZheng restored the issue-7310 branch March 25, 2024 18:33
@AbnerZheng AbnerZheng reopened this Mar 25, 2024
Copy link
Collaborator

@mattsse mattsse left a 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

@@ -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
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

)
.await?
.map(|transfer_operations| transfer_operations.into_iter().map(Into::into).collect())
.ok_or_else(|| internal_rpc_err("failed to inspect transaction"))
Copy link
Collaborator

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

Copy link
Contributor Author

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

|_tx_info, inspector, _, _| Ok(inspector.into_transfers()),
)
.await?
.map(|transfer_operations| transfer_operations.into_iter().map(Into::into).collect())
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@mattsse mattsse added C-enhancement New feature or request A-rpc Related to the RPC implementation labels Mar 25, 2024
@mattsse mattsse added this pull request to the merge queue Mar 26, 2024
Merged via the queue into paradigmxyz:main with commit 903fc2d Mar 26, 2024
28 checks passed
@AbnerZheng AbnerZheng deleted the issue-7310 branch March 30, 2024 06:25
Ruteri pushed a commit to Ruteri/reth that referenced this pull request Apr 17, 2024
Ruteri pushed a commit to Ruteri/reth that referenced this pull request Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement ots_getInternalOperations
2 participants