Skip to content

Commit

Permalink
Add cast paymaster tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrigada committed Oct 22, 2024
1 parent 01cd764 commit e5ae334
Show file tree
Hide file tree
Showing 3 changed files with 175 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/cast/bin/cmd/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ pub struct ZksyncParams {
zksync: bool,

/// The paymaster address for the ZKSync transaction
#[arg(long = "zk-paymaster-address", requires_all = ["paymaster_input"])]
#[arg(long = "zk-paymaster-address", requires = "paymaster_input")]
paymaster_address: Option<String>,

/// The paymaster input for the ZKSync transaction
#[arg(long = "zk-paymaster-input", requires_all = ["paymaster_address"])]
#[arg(long = "zk-paymaster-input", requires = "paymaster_address")]
paymaster_input: Option<String>,
}

Expand Down
4 changes: 3 additions & 1 deletion crates/cast/bin/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ where
}

if let Some(gas_price) = tx_opts.gas_price {
if legacy {
// We need to set the gas price to be able to create the EIP-712 transaction in
// zkcontext
if legacy || config.zksync.startup {
tx.set_gas_price(gas_price.to());
} else {
tx.set_max_fee_per_gas(gas_price.to());
Expand Down
Loading

0 comments on commit e5ae334

Please sign in to comment.