Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions rust/tw_evm/src/transaction/user_operation_v0_7.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,23 +188,15 @@ impl SignedTransaction for SignedUserOperationV0_7 {
let tx = SignedUserOperationV0_7Serde {
sender: self.unsigned.sender.to_string(),
nonce: self.unsigned.nonce.to_string(),
factory: self
.unsigned
.factory
.map(|addr| addr.to_string())
.unwrap_or_default(),
factory: self.unsigned.factory.map(|addr| addr.to_string()),
factory_data: hex::encode(&self.unsigned.factory_data, prefix),
call_data: hex::encode(&self.unsigned.call_data, prefix),
call_data_gas_limit: self.unsigned.call_data_gas_limit.to_string(),
verification_gas_limit: self.unsigned.verification_gas_limit.to_string(),
pre_verification_gas: self.unsigned.pre_verification_gas.to_string(),
max_fee_per_gas: self.unsigned.max_fee_per_gas.to_string(),
max_priority_fee_per_gas: self.unsigned.max_priority_fee_per_gas.to_string(),
paymaster: self
.unsigned
.paymaster
.map(|addr| addr.to_string())
.unwrap_or_default(),
paymaster: self.unsigned.paymaster.map(|addr| addr.to_string()),
paymaster_verification_gas_limit: self
.unsigned
.paymaster_verification_gas_limit
Expand All @@ -229,15 +221,15 @@ impl SignedTransaction for SignedUserOperationV0_7 {
struct SignedUserOperationV0_7Serde {
sender: String,
nonce: String,
factory: String,
factory: Option<String>,
factory_data: String,
Copy link
Contributor

Choose a reason for hiding this comment

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

Intuitively, if the factory is optional, then the factory_data should also be optional. 😃

call_data: String,
call_data_gas_limit: String,
verification_gas_limit: String,
pre_verification_gas: String,
max_fee_per_gas: String,
max_priority_fee_per_gas: String,
paymaster: String,
paymaster: Option<String>,
paymaster_verification_gas_limit: String,
paymaster_post_op_gas_limit: String,
paymaster_data: String,
Expand Down
Loading