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: Alloy migration #2

Merged
merged 3 commits into from
Oct 6, 2023
Merged

feat: Alloy migration #2

merged 3 commits into from
Oct 6, 2023

Conversation

Evalir
Copy link
Member

@Evalir Evalir commented Oct 6, 2023

Migrates the repo to alloy. The only remaining ethers types is Chain, which is still being worked on as a separate package.

@Evalir Evalir marked this pull request as ready for review October 6, 2023 01:59
use std::{fmt, str::FromStr};

/// A block number or tag.
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Hash)]
Copy link
Member Author

Choose a reason for hiding this comment

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

This eventually should come from RPC types.

Copy link
Member

Choose a reason for hiding this comment

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

};

/// Helper type to parse numeric strings, `u64` and `U256`
#[derive(Deserialize, Debug, Clone)]
Copy link
Member Author

Choose a reason for hiding this comment

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

These were moved from ethers_core

Copy link
Member

Choose a reason for hiding this comment

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

How do we do this in Reth? @mattsse


/// Common Ethereum unit types.
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
pub enum Units {
Copy link
Member Author

Choose a reason for hiding this comment

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

Also moved from ethers_core. This feels like it should live somewhere else (maybe alloy), as a primitive.

Copy link
Member

Choose a reason for hiding this comment

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

@prestwich @DaniPopes I am OK w/ moving this to core/ but no strong opinions

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.

this adds a bunch of rpc junk that should live somewhere else, alloy-rpc-types I think.

so perhaps we do that first?

but also fine with doing some duplication here in the meantime

Copy link
Member

@gakonst gakonst left a comment

Choose a reason for hiding this comment

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

Good w/ me. The follow-up should remove RawAbi. I don't mind the BlockNumber type being here, let's open ticket for removing it when we have it in the RPC types.

use std::{fmt, str::FromStr};

/// A block number or tag.
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Hash)]
Copy link
Member

Choose a reason for hiding this comment

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

};
use alloy_json_abi::JsonAbi as Abi;
use alloy_primitives::{Address, Bytes};
use ethers_core::abi::RawAbi;
Copy link
Member

Choose a reason for hiding this comment

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

This should be removed and adjusted to the right Alloy type, am OK w/ doing in follow up.

};

/// Helper type to parse numeric strings, `u64` and `U256`
#[derive(Deserialize, Debug, Clone)]
Copy link
Member

Choose a reason for hiding this comment

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

How do we do this in Reth? @mattsse


/// Common Ethereum unit types.
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
pub enum Units {
Copy link
Member

Choose a reason for hiding this comment

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

@prestwich @DaniPopes I am OK w/ moving this to core/ but no strong opinions

Comment on lines -102 to +107
assert_eq!(item.abi().unwrap(), serde_json::from_str(DAO_ABI).unwrap());
assert_eq!(
item.abi().unwrap(),
serde_json::from_str(DEPOSIT_CONTRACT_ABI).unwrap()
Copy link
Member

Choose a reason for hiding this comment

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

did anything not work with the DAO ABI?

@gakonst gakonst merged commit ca86275 into main Oct 6, 2023
5 checks passed
@gakonst gakonst deleted the evalir/migrate-to-alloy branch October 6, 2023 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants