Skip to content

Conversation

@bguillaumat-squads
Copy link
Contributor

This pull request introduces support for specifying a separate fee payer in the VaultTransactionExecute command. The most significant changes involve adding a new optional argument for the fee payer keypair and updating the transaction creation logic to accommodate this new feature.

Enhancements to VaultTransactionExecute:

  • Added a new optional argument fee_payer_keypair to the VaultTransactionExecute struct to allow specifying a separate fee payer for transactions. (cli/src/command/vault_transaction_execute.rs, cli/src/command/vault_transaction_execute.rsR58-R60)
  • Updated the transaction execution logic to include the fee payer keypair in the list of signers if it differs from the transaction creator. (cli/src/command/vault_transaction_execute.rs, cli/src/command/vault_transaction_execute.rsR197-R201)
  • Modified the transaction message creation to use the fee payer's public key if provided; otherwise, it defaults to the transaction creator's public key. (cli/src/command/vault_transaction_execute.rs, cli/src/command/vault_transaction_execute.rsR171-R177)
  • Added logic to load the fee payer keypair from the provided path and handle it appropriately during transaction execution. (cli/src/command/vault_transaction_execute.rs, [1] [2]

@vercel
Copy link

vercel bot commented Jul 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
v4-sdk-typedoc ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 22, 2025 0:30am

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds support for specifying a separate fee payer in the VaultTransactionExecute command, allowing users to designate a different keypair to pay transaction fees instead of using the transaction creator's keypair.

  • Added optional fee_payer_keypair argument to the command struct
  • Updated transaction message creation to use the fee payer's public key when provided
  • Modified signer logic to include the fee payer keypair when it differs from the transaction creator

Comment on lines 95 to +98
extra_keypair.map(|path| create_signer_from_path(path).unwrap());

let transaction_fee_payer_keypair =
fee_payer_keypair.map(|path| create_signer_from_path(path).unwrap());
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

The use of .unwrap() for error handling is inconsistent with the pattern used elsewhere in the codebase and could cause the program to panic. Consider using proper error handling or .expect() with a descriptive message like the fee payer keypair loading below.

Suggested change
extra_keypair.map(|path| create_signer_from_path(path).unwrap());
let transaction_fee_payer_keypair =
fee_payer_keypair.map(|path| create_signer_from_path(path).unwrap());
extra_keypair.map(|path| create_signer_from_path(path).expect("Failed to load extra keypair from the provided path"));
let transaction_fee_payer_keypair =
fee_payer_keypair.map(|path| create_signer_from_path(path).expect("Failed to load fee payer keypair from the provided path"));

Copilot uses AI. Check for mistakes.
extra_keypair.map(|path| create_signer_from_path(path).unwrap());

let transaction_fee_payer_keypair =
fee_payer_keypair.map(|path| create_signer_from_path(path).unwrap());
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

The use of .unwrap() could cause the program to panic if the keypair file is invalid or inaccessible. Consider using .expect() with a descriptive error message like "Failed to load fee payer keypair" to provide better debugging information.

Suggested change
fee_payer_keypair.map(|path| create_signer_from_path(path).unwrap());
fee_payer_keypair.map(|path| create_signer_from_path(path).expect("Failed to load fee payer keypair"));

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant