Skip to content

Commit

Permalink
feat(7702): use standardized eip7702_auth
Browse files Browse the repository at this point in the history
  • Loading branch information
andysim3d committed Jan 9, 2025
1 parent cbd0734 commit 9fb85ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions crates/rpc/src/types/v0_6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub(crate) struct RpcUserOperation {
max_priority_fee_per_gas: U128,
paymaster_and_data: Bytes,
signature: Bytes,
authorization_tuple: Option<RpcAuthorization>,
eip7702_auth: Option<RpcAuthorization>,
}

impl From<UserOperation> for RpcUserOperation {
Expand All @@ -55,7 +55,7 @@ impl From<UserOperation> for RpcUserOperation {
max_priority_fee_per_gas: U128::from(op.max_priority_fee_per_gas),
paymaster_and_data: op.paymaster_and_data,
signature: op.signature,
authorization_tuple: op.authorization_tuple.map(|a| a.into()),
eip7702_auth: op.authorization_tuple.map(|a| a.into()),
}
}
}
Expand All @@ -78,7 +78,7 @@ impl FromRpc<RpcUserOperation> for UserOperation {
signature: def.signature,
},
ExtendedUserOperation {
authorization_tuple: def.authorization_tuple.map(|a| a.into()),
authorization_tuple: def.eip7702_auth.map(|a| a.into()),
},
)
.build()
Expand Down
12 changes: 6 additions & 6 deletions crates/rpc/src/types/v0_7.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub(crate) struct RpcUserOperation {
paymaster_data: Option<Bytes>,
signature: Bytes,
#[serde(skip_serializing_if = "Option::is_none")]
authorization_tuple: Option<RpcAuthorization>,
eip7702_auth: Option<RpcAuthorization>,
}

impl From<UserOperation> for RpcUserOperation {
Expand Down Expand Up @@ -87,7 +87,7 @@ impl From<UserOperation> for RpcUserOperation {
paymaster_post_op_gas_limit: paymaster_post_op_gas_limit.map(|x| U128::from(x)),
paymaster_data,
signature: op.signature,
authorization_tuple: op.authorization_tuple.map(|a| a.into()),
eip7702_auth: op.authorization_tuple.map(|a| a.into()),
}
}
}
Expand Down Expand Up @@ -123,8 +123,8 @@ impl FromRpc<RpcUserOperation> for UserOperation {
if def.factory.is_some() {
builder = builder.factory(def.factory.unwrap(), def.factory_data.unwrap_or_default());
}
if def.authorization_tuple.is_some() {
builder = builder.authorization_tuple(def.authorization_tuple.map(|a| a.into()));
if def.eip7702_auth.is_some() {
builder = builder.authorization_tuple(def.eip7702_auth.map(|a| a.into()));
}
builder.build()
}
Expand Down Expand Up @@ -159,7 +159,7 @@ pub(crate) struct RpcUserOperationOptionalGas {
paymaster_post_op_gas_limit: Option<U128>,
paymaster_data: Option<Bytes>,
signature: Bytes,
authorization_contract: Option<Address>,
eip7702_auth: Option<RpcAuthorization>,
}

impl From<RpcUserOperationOptionalGas> for UserOperationOptionalGas {
Expand All @@ -180,7 +180,7 @@ impl From<RpcUserOperationOptionalGas> for UserOperationOptionalGas {
paymaster_post_op_gas_limit: def.paymaster_post_op_gas_limit.map(|x| x.to()),
paymaster_data: def.paymaster_data.unwrap_or_default(),
signature: def.signature,
authorization_contract: def.authorization_contract,
authorization_contract: def.eip7702_auth.map(|a| a.address),
}
}
}
Expand Down

0 comments on commit 9fb85ec

Please sign in to comment.