Skip to content

Commit

Permalink
chore: upgrade alloy (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris13524 authored Sep 10, 2024
1 parent d3a0f7e commit 81e70e0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
3 changes: 1 addition & 2 deletions crates/yttrium/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rust-version.workspace = true

[dependencies]
# Ethereum
alloy = { git = "https://github.com/alloy-rs/alloy", rev = "b000e16", features = [
alloy = { git = "https://github.com/alloy-rs/alloy", version = "0.3.2", features = [
"contract",
"network",
"providers",
Expand Down Expand Up @@ -48,5 +48,4 @@ wiremock = "0.6.0"
reqwest.workspace = true

[build-dependencies]
alloy-primitives = { version = "0.7.0" }
serde_json = "1"
14 changes: 14 additions & 0 deletions crates/yttrium/src/entry_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ pub const ENTRYPOINT_ADDRESS_V07: &str =
pub const ENTRYPOINT_V06_TYPE: &str = "v0.6";
pub const ENTRYPOINT_V07_TYPE: &str = "v0.7";

sol! (
struct PackedUserOperation {
address sender;
uint256 nonce;
bytes initCode;
bytes callData;
bytes32 accountGasLimits;
uint256 preVerificationGas;
bytes32 gasFees;
bytes paymasterAndData;
bytes signature;
}
);

sol!(
#[allow(missing_docs)]
#[sol(rpc)]
Expand Down
4 changes: 2 additions & 2 deletions crates/yttrium/src/smart_accounts/nonce.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use alloy::primitives::U256;
use alloy::primitives::aliases::U192;

pub async fn get_nonce<P, T, N>(
provider: &P,
Expand All @@ -14,7 +14,7 @@ where
entry_point_address.to_address(),
provider,
);
let key = U256::ZERO;
let key = U192::ZERO;

let get_nonce_call =
entry_point_instance.getNonce(address.to_address(), key).call().await?;
Expand Down
8 changes: 5 additions & 3 deletions crates/yttrium/src/transaction/send/safe_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ mod tests {
use alloy::{
dyn_abi::{DynSolValue, Eip712Domain},
network::Ethereum,
primitives::{Address, Bytes, FixedBytes, Uint, U128, U256},
primitives::{
aliases::U48, Address, Bytes, FixedBytes, Uint, U128, U256,
},
providers::{ext::AnvilApi, Provider, ReqwestProvider},
signers::{k256::ecdsa::SigningKey, local::LocalSigner, SignerSync},
sol,
Expand Down Expand Up @@ -243,8 +245,8 @@ mod tests {
op
};

let valid_after = 0;
let valid_until = 0;
let valid_after = U48::from(0);
let valid_until = U48::from(0);

sol!(
struct SafeOp {
Expand Down
2 changes: 1 addition & 1 deletion crates/yttrium/src/transaction/send/simple_account_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ mod tests {
providers::ProviderBuilder,
signers::local::LocalSigner,
};
use std::{str::FromStr, time::Duration};
use std::str::FromStr;

async fn send_transaction(
transaction: Transaction,
Expand Down

0 comments on commit 81e70e0

Please sign in to comment.