-
Notifications
You must be signed in to change notification settings - Fork 72
feat(cli): Add the possibility to select a fee payer for a vault tx exec #158
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this 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_keypairargument 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
| 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()); |
Copilot
AI
Jul 21, 2025
There was a problem hiding this comment.
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.
| 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")); |
| 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()); |
Copilot
AI
Jul 21, 2025
There was a problem hiding this comment.
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.
| 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")); |
e211c56 to
bf1e660
Compare
This pull request introduces support for specifying a separate fee payer in the
VaultTransactionExecutecommand. 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:fee_payer_keypairto theVaultTransactionExecutestruct to allow specifying a separate fee payer for transactions. (cli/src/command/vault_transaction_execute.rs, cli/src/command/vault_transaction_execute.rsR58-R60)cli/src/command/vault_transaction_execute.rs, cli/src/command/vault_transaction_execute.rsR197-R201)cli/src/command/vault_transaction_execute.rs, cli/src/command/vault_transaction_execute.rsR171-R177)cli/src/command/vault_transaction_execute.rs, [1] [2]