diff --git a/CHANGELOG.md b/CHANGELOG.md index ec2598ba07..03d87b0b4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,8 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Added - `--test-files` flag to `verify` command to include test files under src/ for verification (only applies to voyager) - -### Cast +- `--tip` flag to `invoke`, `declare`, `deploy`, `multicall run` and `account deploy` commands to set the transaction tip #### Changed diff --git a/Cargo.lock b/Cargo.lock index 6eb740cb5c..622c21de92 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1491,7 +1491,7 @@ dependencies = [ "serde_json", "sha2", "sha3", - "starknet-crypto 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "starknet-crypto", "starknet-types-core", "thiserror 2.0.15", "zip", @@ -5901,7 +5901,7 @@ dependencies = [ "shellexpand", "snapbox", "starknet", - "starknet-crypto 0.7.4 (git+https://github.com/xJonathanLEI/starknet-rs?rev=a70f4ce)", + "starknet-crypto", "starknet-types-core", "tempfile", "test-case", @@ -5978,7 +5978,7 @@ dependencies = [ "starknet-contract", "starknet-core 0.16.0-rc.3", "starknet-core-derive", - "starknet-crypto 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "starknet-crypto", "starknet-macros", "starknet-providers", "starknet-signers", @@ -5993,7 +5993,7 @@ dependencies = [ "async-trait", "auto_impl", "starknet-core 0.16.0-rc.3", - "starknet-crypto 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "starknet-crypto", "starknet-providers", "starknet-signers", "thiserror 1.0.69", @@ -6033,7 +6033,7 @@ dependencies = [ "serde_with", "sha3", "starknet-core-derive", - "starknet-crypto 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "starknet-crypto", "starknet-types-core", ] @@ -6056,7 +6056,7 @@ dependencies = [ "serde_with", "sha3", "starknet-core-derive", - "starknet-crypto 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "starknet-crypto", "starknet-types-core", ] @@ -6085,25 +6085,7 @@ dependencies = [ "num-traits", "rfc6979", "sha2", - "starknet-curve 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "starknet-types-core", - "zeroize", -] - -[[package]] -name = "starknet-crypto" -version = "0.7.4" -source = "git+https://github.com/xJonathanLEI/starknet-rs?rev=a70f4ce#a70f4cef2032ea0ea839d615426e42a74993bf0b" -dependencies = [ - "crypto-bigint", - "hex", - "hmac", - "num-bigint", - "num-integer", - "num-traits", - "rfc6979", - "sha2", - "starknet-curve 0.5.1 (git+https://github.com/xJonathanLEI/starknet-rs?rev=a70f4ce)", + "starknet-curve", "starknet-types-core", "zeroize", ] @@ -6117,14 +6099,6 @@ dependencies = [ "starknet-types-core", ] -[[package]] -name = "starknet-curve" -version = "0.5.1" -source = "git+https://github.com/xJonathanLEI/starknet-rs?rev=a70f4ce#a70f4cef2032ea0ea839d615426e42a74993bf0b" -dependencies = [ - "starknet-types-core", -] - [[package]] name = "starknet-macros" version = "0.2.5-rc.3" @@ -6169,7 +6143,7 @@ dependencies = [ "getrandom 0.2.16", "rand 0.8.5", "starknet-core 0.16.0-rc.3", - "starknet-crypto 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "starknet-crypto", "thiserror 1.0.69", ] @@ -6220,7 +6194,7 @@ dependencies = [ "serde_json", "sha3", "size-of", - "starknet-crypto 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "starknet-crypto", "starknet-types-core", "strum 0.25.0", "strum_macros 0.25.3", diff --git a/Cargo.toml b/Cargo.toml index d892d7ae75..34a44d194b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,7 +65,7 @@ regex = "1.11.1" serde = { version = "1.0.219", features = ["derive"] } serde_json = "1.0.140" starknet = "0.17.0-rc.3" -starknet-crypto = { git = "https://github.com/xJonathanLEI/starknet-rs", rev = "a70f4ce" } +starknet-crypto = "0.7.4" tempfile = "3.20.0" thiserror = "2.0.12" ctor = "0.4.1" diff --git a/crates/sncast/src/helpers/fee.rs b/crates/sncast/src/helpers/fee.rs index 483d843bc0..e9b759e60d 100644 --- a/crates/sncast/src/helpers/fee.rs +++ b/crates/sncast/src/helpers/fee.rs @@ -33,6 +33,10 @@ pub struct FeeArgs { /// Max L1 data gas price in Fri. If not provided, will be automatically estimated. #[arg(long)] pub l1_data_gas_price: Option, + + /// Tip for the transaction. If not provided, it will be set to 0. + #[arg(long)] + pub tip: Option, } impl From for FeeArgs { @@ -54,6 +58,7 @@ impl From for FeeArgs { l2_gas_price, l1_data_gas, l1_data_gas_price, + tip: Some(0), } } } @@ -75,7 +80,9 @@ impl FeeArgs { ); let fee_settings = FeeSettings::try_from(fee_estimate.clone()) - .expect("Failed to convert FeeEstimate to FeeSettings"); + .expect("Failed to convert FeeEstimate to FeeSettings") + .update_tip(self.tip.unwrap_or(0)); // If a tip is not provided, set it to 0 + Ok(fee_settings) } else { let fee_settings = FeeSettings::from(self.clone()); @@ -105,6 +112,17 @@ pub struct FeeSettings { pub l2_gas_price: Option, pub l1_data_gas: Option, pub l1_data_gas_price: Option, + pub tip: Option, +} + +impl FeeSettings { + #[must_use] + pub fn update_tip(&self, tip: u64) -> FeeSettings { + FeeSettings { + tip: Some(tip), + ..*self + } + } } impl TryFrom for FeeSettings { @@ -117,6 +135,7 @@ impl TryFrom for FeeSettings { l2_gas_price: Some(fee_estimate.l2_gas_price), l1_data_gas: Some(fee_estimate.l1_data_gas_consumed), l1_data_gas_price: Some(fee_estimate.l1_data_gas_price), + tip: None, }) } } @@ -130,6 +149,7 @@ impl From for FeeSettings { l2_gas_price: fee_args.l2_gas_price, l1_data_gas: fee_args.l1_data_gas, l1_data_gas_price: fee_args.l1_data_gas_price, + tip: Some(fee_args.tip.unwrap_or(0)), } } } @@ -168,6 +188,7 @@ mod tests { l2_gas_price: Some(4), l1_data_gas: Some(5), l1_data_gas_price: Some(6), + tip: None, } ); } diff --git a/crates/sncast/src/starknet_commands/account/deploy.rs b/crates/sncast/src/starknet_commands/account/deploy.rs index 0566a7e23e..1a0a2bc3ee 100644 --- a/crates/sncast/src/starknet_commands/account/deploy.rs +++ b/crates/sncast/src/starknet_commands/account/deploy.rs @@ -304,6 +304,7 @@ where l2_gas_price, l1_data_gas, l1_data_gas_price, + tip, } = fee_settings.expect("Failed to convert to fee settings"); let deployment = apply_optional_fields!( @@ -313,7 +314,8 @@ where l2_gas => AccountDeploymentV3::l2_gas, l2_gas_price => AccountDeploymentV3::l2_gas_price, l1_data_gas => AccountDeploymentV3::l1_data_gas, - l1_data_gas_price => AccountDeploymentV3::l1_data_gas_price + l1_data_gas_price => AccountDeploymentV3::l1_data_gas_price, + tip => AccountDeploymentV3::tip ); let result = deployment.send().await; diff --git a/crates/sncast/src/starknet_commands/declare.rs b/crates/sncast/src/starknet_commands/declare.rs index 8c2525bfe8..1c9e850be2 100644 --- a/crates/sncast/src/starknet_commands/declare.rs +++ b/crates/sncast/src/starknet_commands/declare.rs @@ -97,6 +97,7 @@ pub async fn declare( l2_gas_price, l1_data_gas, l1_data_gas_price, + tip, } = fee_settings.expect("Failed to convert to fee settings"); let declaration = apply_optional_fields!( @@ -107,6 +108,7 @@ pub async fn declare( l2_gas_price => DeclarationV3::l2_gas_price, l1_data_gas => DeclarationV3::l1_data_gas, l1_data_gas_price => DeclarationV3::l1_data_gas_price, + tip => DeclarationV3::tip, declare.nonce => DeclarationV3::nonce ); diff --git a/crates/sncast/src/starknet_commands/deploy.rs b/crates/sncast/src/starknet_commands/deploy.rs index d06dcee29e..6be31bedf5 100644 --- a/crates/sncast/src/starknet_commands/deploy.rs +++ b/crates/sncast/src/starknet_commands/deploy.rs @@ -92,6 +92,7 @@ pub async fn deploy( l2_gas_price, l1_data_gas, l1_data_gas_price, + tip, } = fee_settings.expect("Failed to convert to fee settings"); let deployment = apply_optional_fields!( @@ -102,6 +103,7 @@ pub async fn deploy( l2_gas_price => DeploymentV3::l2_gas_price, l1_data_gas => DeploymentV3::l1_data_gas, l1_data_gas_price => DeploymentV3::l1_data_gas_price, + tip => DeploymentV3::tip, nonce => DeploymentV3::nonce ); let result = deployment.send().await; diff --git a/crates/sncast/src/starknet_commands/invoke.rs b/crates/sncast/src/starknet_commands/invoke.rs index 3b87d368ba..978c779a77 100644 --- a/crates/sncast/src/starknet_commands/invoke.rs +++ b/crates/sncast/src/starknet_commands/invoke.rs @@ -88,6 +88,7 @@ pub async fn execute_calls( l2_gas_price, l1_data_gas, l1_data_gas_price, + tip, } = fee_settings.expect("Failed to convert to fee settings"); let execution = apply_optional_fields!( @@ -98,6 +99,7 @@ pub async fn execute_calls( l2_gas_price => ExecutionV3::l2_gas_price, l1_data_gas => ExecutionV3::l1_data_gas, l1_data_gas_price => ExecutionV3::l1_data_gas_price, + tip => ExecutionV3::tip, nonce => ExecutionV3::nonce ); let result = execution.send().await; diff --git a/crates/sncast/tests/e2e/call.rs b/crates/sncast/tests/e2e/call.rs index b2aacf42fc..ac00a442e9 100644 --- a/crates/sncast/tests/e2e/call.rs +++ b/crates/sncast/tests/e2e/call.rs @@ -72,6 +72,7 @@ async fn test_call_after_storage_changed() { l2_gas_price: Some(100_000_000_000_000_000), l1_data_gas: Some(100_000), l1_data_gas_price: Some(10_000_000_000_000), + tip: Some(100_000), }; invoke_contract( "user2", diff --git a/crates/sncast/tests/e2e/declare.rs b/crates/sncast/tests/e2e/declare.rs index e5b3273edb..4bde4823e3 100644 --- a/crates/sncast/tests/e2e/declare.rs +++ b/crates/sncast/tests/e2e/declare.rs @@ -2,8 +2,8 @@ use crate::helpers::constants::{CONTRACTS_DIR, DEVNET_OZ_CLASS_HASH_CAIRO_0, URL use crate::helpers::fee::apply_test_resource_bounds_flags; use crate::helpers::fixtures::{ copy_directory_to_tempdir, create_and_deploy_account, create_and_deploy_oz_account, - duplicate_contract_directory_with_salt, get_accounts_path, get_transaction_hash, - get_transaction_receipt, join_tempdirs, + duplicate_contract_directory_with_salt, get_accounts_path, get_transaction_by_hash, + get_transaction_hash, get_transaction_receipt, join_tempdirs, }; use crate::helpers::runner::runner; use configuration::CONFIG_FILENAME; @@ -13,6 +13,7 @@ use sncast::AccountType; use sncast::helpers::constants::{BRAAVOS_CLASS_HASH, OZ_CLASS_HASH, READY_CLASS_HASH}; use sncast::helpers::fee::FeeArgs; use starknet::core::types::TransactionReceipt::Declare; +use starknet::core::types::{DeclareTransaction, Transaction, TransactionExecutionStatus}; use starknet_types_core::felt::{Felt, NonZeroFelt}; use std::fs; use test_case::test_case; @@ -105,6 +106,7 @@ async fn test_happy_case(class_hash: Felt, account_type: AccountType) { l1_gas_price: None, l2_gas: None, l2_gas_price: None, + tip: Some(100_000), }; "max_fee")] #[test_case(FeeArgs{ max_fee: None, @@ -114,6 +116,7 @@ async fn test_happy_case(class_hash: Felt, account_type: AccountType) { l1_gas_price: Some(10_000_000_000_000), l2_gas: Some(1_000_000_000), l2_gas_price: Some(100_000_000_000_000_000_000), + tip: None, }; "resource_bounds")] #[tokio::test] async fn test_happy_case_different_fees(fee_args: FeeArgs) { @@ -166,6 +169,7 @@ async fn test_happy_case_different_fees(fee_args: FeeArgs) { "--l2-gas-price", fee_args.l2_gas_price.map(|x| x.to_string()), ), + ("--tip", fee_args.tip.map(|x| x.to_string())), ]; for &(key, ref value) in &options { @@ -176,14 +180,22 @@ async fn test_happy_case_different_fees(fee_args: FeeArgs) { } let snapbox = runner(&args).current_dir(tempdir.path()); - let output = snapbox.assert().success(); - - let output = output.get_output().stdout.clone(); + let output = snapbox.assert().success().get_output().stdout.clone(); let hash = get_transaction_hash(&output); - let receipt = get_transaction_receipt(hash).await; + let Declare(receipt) = get_transaction_receipt(hash).await else { + panic!("Should be Declare receipt"); + }; + assert_eq!( + receipt.execution_result.status(), + TransactionExecutionStatus::Succeeded + ); - assert!(matches!(receipt, Declare(_))); + let Transaction::Declare(DeclareTransaction::V3(tx)) = get_transaction_by_hash(hash).await + else { + panic!("Expected Declare V3 transaction") + }; + assert_eq!(tx.tip, fee_args.tip.unwrap_or(0)); } #[tokio::test] diff --git a/crates/sncast/tests/e2e/deploy.rs b/crates/sncast/tests/e2e/deploy.rs index eec879eb62..667c222bd0 100644 --- a/crates/sncast/tests/e2e/deploy.rs +++ b/crates/sncast/tests/e2e/deploy.rs @@ -4,8 +4,8 @@ use crate::helpers::constants::{ }; use crate::helpers::fee::apply_test_resource_bounds_flags; use crate::helpers::fixtures::{ - create_and_deploy_account, create_and_deploy_oz_account, get_transaction_hash, - get_transaction_receipt, + create_and_deploy_account, create_and_deploy_oz_account, get_transaction_by_hash, + get_transaction_hash, get_transaction_receipt, }; use crate::helpers::runner::runner; use crate::helpers::shell::os_specific_shell; @@ -17,6 +17,7 @@ use sncast::AccountType; use sncast::helpers::constants::OZ_CLASS_HASH; use sncast::helpers::fee::FeeArgs; use starknet::core::types::TransactionReceipt::Deploy; +use starknet::core::types::{InvokeTransaction, Transaction, TransactionExecutionStatus}; use starknet_types_core::felt::{Felt, NonZeroFelt}; use test_case::test_case; @@ -102,6 +103,7 @@ async fn test_happy_case(class_hash: Felt, account_type: AccountType) { l1_gas_price: None, l2_gas: None, l2_gas_price: None, + tip: None, }; "max_fee")] #[test_case(FeeArgs{ max_fee: None, @@ -111,6 +113,7 @@ async fn test_happy_case(class_hash: Felt, account_type: AccountType) { l1_gas_price: Some(10_000_000_000_000), l2_gas: Some(1_000_000_000), l2_gas_price: Some(100_000_000_000_000_000_000), + tip: Some(100_000), }; "resource_bounds")] #[tokio::test] async fn test_happy_case_different_fees(fee_args: FeeArgs) { @@ -151,6 +154,7 @@ async fn test_happy_case_different_fees(fee_args: FeeArgs) { "--l2-gas-price", fee_args.l2_gas_price.map(|x| x.to_string()), ), + ("--tip", fee_args.tip.map(|x| x.to_string())), ]; for &(key, ref value) in &options { @@ -162,10 +166,20 @@ async fn test_happy_case_different_fees(fee_args: FeeArgs) { let snapbox = runner(&args).current_dir(tempdir.path()); let output = snapbox.assert().success().get_output().stdout.clone(); + let hash = get_transaction_hash(&output); - let receipt = get_transaction_receipt(hash).await; + let Deploy(receipt) = get_transaction_receipt(hash).await else { + panic!("Should be Deploy receipt"); + }; + assert_eq!( + receipt.execution_result.status(), + TransactionExecutionStatus::Succeeded + ); - assert!(matches!(receipt, Deploy(_))); + let Transaction::Invoke(InvokeTransaction::V3(tx)) = get_transaction_by_hash(hash).await else { + panic!("Expected Invoke V3 transaction") + }; + assert_eq!(tx.tip, fee_args.tip.unwrap_or(0)); } #[tokio::test] diff --git a/crates/sncast/tests/e2e/invoke.rs b/crates/sncast/tests/e2e/invoke.rs index c12cc8c9a5..ace591b7cb 100644 --- a/crates/sncast/tests/e2e/invoke.rs +++ b/crates/sncast/tests/e2e/invoke.rs @@ -4,8 +4,8 @@ use crate::helpers::constants::{ }; use crate::helpers::fee::apply_test_resource_bounds_flags; use crate::helpers::fixtures::{ - create_and_deploy_account, create_and_deploy_oz_account, get_transaction_hash, - get_transaction_receipt, + create_and_deploy_account, create_and_deploy_oz_account, get_transaction_by_hash, + get_transaction_hash, get_transaction_receipt, }; use crate::helpers::runner::runner; use crate::helpers::shell::os_specific_shell; @@ -17,6 +17,7 @@ use sncast::AccountType; use sncast::helpers::constants::{BRAAVOS_CLASS_HASH, OZ_CLASS_HASH, READY_CLASS_HASH}; use sncast::helpers::fee::FeeArgs; use starknet::core::types::TransactionReceipt::Invoke; +use starknet::core::types::{InvokeTransaction, Transaction, TransactionExecutionStatus}; use starknet_types_core::felt::{Felt, NonZeroFelt}; use test_case::test_case; @@ -104,6 +105,7 @@ async fn test_happy_case(class_hash: Felt, account_type: AccountType) { l1_gas_price: None, l2_gas: None, l2_gas_price: None, + tip: None, }; "max_fee")] #[test_case(FeeArgs{ max_fee: None, @@ -113,6 +115,7 @@ async fn test_happy_case(class_hash: Felt, account_type: AccountType) { l1_gas_price: Some(10_000_000_000_000), l2_gas: Some(1_000_000_000), l2_gas_price: Some(100_000_000_000_000_000_000), + tip: Some(100_000_000), }; "resource_bounds")] #[tokio::test] async fn test_happy_case_different_fees(fee_args: FeeArgs) { @@ -153,6 +156,7 @@ async fn test_happy_case_different_fees(fee_args: FeeArgs) { "--l2-gas-price", fee_args.l2_gas_price.map(|x| x.to_string()), ), + ("--tip", fee_args.tip.map(|x| x.to_string())), ]; for &(key, ref value) in &options { @@ -166,9 +170,18 @@ async fn test_happy_case_different_fees(fee_args: FeeArgs) { let output = snapbox.assert().success().get_output().stdout.clone(); let hash = get_transaction_hash(&output); - let receipt = get_transaction_receipt(hash).await; + let Invoke(receipt) = get_transaction_receipt(hash).await else { + panic!("Should be Invoke receipt"); + }; + assert_eq!( + receipt.execution_result.status(), + TransactionExecutionStatus::Succeeded + ); - assert!(matches!(receipt, Invoke(_))); + let Transaction::Invoke(InvokeTransaction::V3(tx)) = get_transaction_by_hash(hash).await else { + panic!("Expected Invoke V3 transaction") + }; + assert_eq!(tx.tip, fee_args.tip.unwrap_or(0)); } #[tokio::test] diff --git a/crates/sncast/tests/helpers/fixtures.rs b/crates/sncast/tests/helpers/fixtures.rs index 81e997d507..71c58416fd 100644 --- a/crates/sncast/tests/helpers/fixtures.rs +++ b/crates/sncast/tests/helpers/fixtures.rs @@ -23,7 +23,7 @@ use sncast::{get_account, get_provider}; use starknet::accounts::{ Account, AccountFactory, ArgentAccountFactory, ExecutionV3, OpenZeppelinAccountFactory, }; -use starknet::core::types::{Call, InvokeTransactionResult, TransactionReceipt}; +use starknet::core::types::{Call, InvokeTransactionResult, Transaction, TransactionReceipt}; use starknet::core::utils::get_contract_address; use starknet::core::utils::get_selector_from_name; use starknet::providers::JsonRpcClient; @@ -326,6 +326,38 @@ pub async fn get_transaction_receipt(tx_hash: Felt) -> TransactionReceipt { .expect("Could not serialize result to `TransactionReceipt`") } +pub async fn get_transaction_by_hash(tx_hash: Felt) -> Transaction { + let client = reqwest::Client::new(); + let json = json!( + { + "jsonrpc": "2.0", + "method": "starknet_getTransactionByHash", + "params": { + "transaction_hash": format!("{tx_hash:#x}"), + }, + "id": 0, + } + ); + let resp: Value = serde_json::from_str( + &client + .post(URL) + .header("Content-Type", "application/json") + .body(json.to_string()) + .send() + .await + .expect("Error occurred while getting transaction") + .text() + .await + .expect("Could not get response from getTransactionByHash"), + ) + .expect("Could not serialize getTransactionByHash response"); + + let result = resp + .get("result") + .expect("There is no `result` field in getTransactionByHash response"); + serde_json::from_str(&result.to_string()).expect("Could not serialize result to `Transaction`") +} + #[must_use] pub fn create_test_provider() -> JsonRpcClient { let parsed_url = Url::parse(URL).unwrap(); diff --git a/crates/sncast/tests/integration/fee.rs b/crates/sncast/tests/integration/fee.rs index f747301fc5..760fb60df1 100644 --- a/crates/sncast/tests/integration/fee.rs +++ b/crates/sncast/tests/integration/fee.rs @@ -12,6 +12,7 @@ async fn test_happy_case() { l2_gas_price: Some(200), l1_data_gas: Some(100), l1_data_gas_price: Some(200), + tip: None, }; let settings = args.try_into_fee_settings(None).unwrap(); @@ -25,6 +26,7 @@ async fn test_happy_case() { l2_gas_price: Some(200), l1_data_gas: Some(100), l1_data_gas_price: Some(200), + tip: Some(0), } ); } @@ -39,6 +41,7 @@ async fn test_max_fee_none() { l2_gas_price: Some(100), l1_data_gas: Some(100), l1_data_gas_price: Some(100), + tip: Some(100), }; let settings = args.try_into_fee_settings(None).unwrap(); @@ -52,6 +55,7 @@ async fn test_max_fee_none() { l2_gas_price: Some(100), l1_data_gas: Some(100), l1_data_gas_price: Some(100), + tip: Some(100), } ); } @@ -76,6 +80,7 @@ async fn test_max_fee_set() { l2_gas_price: None, l1_data_gas: None, l1_data_gas_price: None, + tip: None, }; let settings = args @@ -91,6 +96,7 @@ async fn test_max_fee_set() { l2_gas_price: Some(4), l1_data_gas: Some(5), l1_data_gas_price: Some(6), + tip: Some(0), } ); } @@ -115,6 +121,7 @@ async fn test_max_fee_set_and_fee_estimate_higher() { l2_gas_price: None, l1_data_gas: None, l1_data_gas_price: None, + tip: None, }; let err = args @@ -142,6 +149,7 @@ async fn test_max_fee_set_and_fee_estimate_none() { l2_gas_price: None, l1_data_gas: None, l1_data_gas_price: None, + tip: None, }; args.try_into_fee_settings(None).unwrap(); @@ -157,6 +165,7 @@ async fn test_all_args_none() { l2_gas_price: None, l1_data_gas: None, l1_data_gas_price: None, + tip: None, }; let settings = args.try_into_fee_settings(None).unwrap(); @@ -170,6 +179,7 @@ async fn test_all_args_none() { l2_gas_price: None, l1_data_gas: None, l1_data_gas_price: None, + tip: Some(0), } ); } diff --git a/crates/sncast/tests/integration/wait_for_tx.rs b/crates/sncast/tests/integration/wait_for_tx.rs index 52c0f23855..9b7fb3f9ad 100644 --- a/crates/sncast/tests/integration/wait_for_tx.rs +++ b/crates/sncast/tests/integration/wait_for_tx.rs @@ -74,6 +74,7 @@ async fn test_wait_for_reverted_transaction() { l2_gas_price: Some(1), l1_data_gas: Some(1), l1_data_gas_price: Some(1), + tip: None, }; let transaction_hash = invoke_contract( ACCOUNT, diff --git a/docs/src/appendix/sncast/account/deploy.md b/docs/src/appendix/sncast/account/deploy.md index 9ba596f3ff..d2a73a801a 100644 --- a/docs/src/appendix/sncast/account/deploy.md +++ b/docs/src/appendix/sncast/account/deploy.md @@ -55,6 +55,11 @@ Optional. Maximum L1 data gas unit price for the `deploy_account` transaction. When not used, defaults to auto-estimation. +## `--tip ` +Optional. + +Tip for the transaction. When not provided, defaults to 0. + ## `--silent` Optional. diff --git a/docs/src/appendix/sncast/declare.md b/docs/src/appendix/sncast/declare.md index 7b595368f5..16b0ede5dc 100644 --- a/docs/src/appendix/sncast/declare.md +++ b/docs/src/appendix/sncast/declare.md @@ -59,6 +59,10 @@ Optional. Maximum L1 data gas unit price for the `declare` transaction. When not used, defaults to auto-estimation. +## `--tip ` +Optional. + +Tip for the transaction. When not provided, defaults to 0. ## `--nonce, -n ` Optional. diff --git a/docs/src/appendix/sncast/deploy.md b/docs/src/appendix/sncast/deploy.md index 1f2697e8da..b6cd467f95 100644 --- a/docs/src/appendix/sncast/deploy.md +++ b/docs/src/appendix/sncast/deploy.md @@ -84,6 +84,11 @@ Optional. Maximum L1 data gas unit price for the `deploy` transaction. When not used, defaults to auto-estimation. +## `--tip ` +Optional. + +Tip for the transaction. When not provided, defaults to 0. + ## `--nonce, -n ` Optional. diff --git a/docs/src/appendix/sncast/invoke.md b/docs/src/appendix/sncast/invoke.md index 8fcab0812d..e1b468ae90 100644 --- a/docs/src/appendix/sncast/invoke.md +++ b/docs/src/appendix/sncast/invoke.md @@ -80,6 +80,11 @@ Optional. Maximum L1 data gas unit price for the `invoke` transaction. When not used, defaults to auto-estimation. +## `--tip ` +Optional. + +Tip for the transaction. When not provided, defaults to 0. + ## `--nonce, -n ` Optional. diff --git a/docs/src/appendix/sncast/multicall/run.md b/docs/src/appendix/sncast/multicall/run.md index dd4f1ed138..c7cfb3a476 100644 --- a/docs/src/appendix/sncast/multicall/run.md +++ b/docs/src/appendix/sncast/multicall/run.md @@ -60,6 +60,11 @@ Optional. Maximum L1 data gas unit price for the `invoke` transaction. When not used, defaults to auto-estimation. +## `--tip ` +Optional. + +Tip for the transaction. When not provided, defaults to 0. + File example: ```toml