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

feat(ser): Trait Abstractions #25

Closed
wants to merge 2 commits into from
Closed

feat(ser): Trait Abstractions #25

wants to merge 2 commits into from

Conversation

refcell
Copy link
Collaborator

@refcell refcell commented Aug 24, 2024

Description

Warning

Follows #22 - don't merge until #22 is in trunk

Adds trait abstractions and associated types to the ser crate.

Metadata

Closes #20

@refcell refcell marked this pull request as draft August 24, 2024 21:22
@refcell refcell changed the title feat(ser): feat(ser): Trait Abstractions Aug 24, 2024
@refcell refcell marked this pull request as ready for review August 25, 2024 00:37
Copy link
Member

@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.

  • suggestions

///
/// [ss]: https://github.com/ethereum-optimism/optimism/blob/develop/op-service/eth/sync_status.go#L5
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct SyncStatus {
Copy link
Member

Choose a reason for hiding this comment

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

before we introduce these here,

could we instead move all of these

https://github.com/paradigmxyz/reth/blob/c788b6a585bbbd7ed92aabc42cb612a6a804daff/crates/optimism/rpc/src/api.rs#L33-L33

to op-alloy instead and import?

but could also do this in a followup

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looks like someone saw this and already put up a pr :) alloy-rs/op-alloy#35

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Happy to wait until that's in and re-use those types.

Comment on lines 30 to 36
fn from(tx: &BatchTransaction) -> Self {
let mut buf: Vec<u8> = Vec::new();
for frame in tx.frames.iter() {
buf.append(&mut frame.encode());
}
buf.into()
}
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer a function for this

@refcell refcell closed this by deleting the head repository Aug 25, 2024
@shekhirin shekhirin added the C-enhancement New feature or request label Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(ser): Trait Abstractions
3 participants