Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type conversion in script "deploy" that resulted in max_fee being omitted #2888

Merged
merged 4 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix fee_token missing in deploy
  • Loading branch information
cptartur committed Jan 29, 2025
commit 73d203e091c60d112161c03126e75145c756b3a5
3 changes: 3 additions & 0 deletions crates/sncast/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ async fn run_async_command(
}

Commands::Deploy(deploy) => {
let fee_token = deploy.validate_and_get_token()?;

let Deploy {
arguments,
fee_args,
Expand Down Expand Up @@ -323,6 +325,7 @@ async fn run_async_command(
deploy.nonce,
&account,
wait_config,
fee_token,
)
.await
.map_err(handle_starknet_command_error);
Expand Down
2 changes: 2 additions & 0 deletions crates/sncast/src/starknet_commands/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ pub async fn deploy(
nonce: Option<Felt>,
account: &SingleOwnerAccount<&JsonRpcClient<HttpTransport>, LocalWallet>,
wait_config: WaitForTx,
fee_token: FeeToken,
) -> Result<DeployResponse, StarknetCommandError> {
let fee_settings = fee_args
.fee_token(fee_token)
.try_into_fee_settings(account.provider(), account.block_id())
.await?;

Expand Down
4 changes: 3 additions & 1 deletion crates/sncast/src/starknet_commands/script/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,9 @@ impl<'a> ExtensionLogic for CastScriptExtension<'a> {
let constructor_calldata = input_reader.read::<Vec<Felt>>()?;
let salt = input_reader.read()?;
let unique = input_reader.read()?;
let fee_args = input_reader.read::<ScriptFeeSettings>()?.into();
let fee_args: FeeArgs = input_reader.read::<ScriptFeeSettings>()?.into();
let nonce = input_reader.read()?;
let fee_token = fee_args.fee_token.clone().unwrap_or_default();

let deploy_tx_id =
generate_deploy_tx_id(class_hash, &constructor_calldata, salt, unique);
Expand All @@ -185,6 +186,7 @@ impl<'a> ExtensionLogic for CastScriptExtension<'a> {
wait: true,
wait_params: self.config.wait_params,
},
fee_token,
));

self.state.maybe_insert_tx_entry(
Expand Down
Loading