-
Notifications
You must be signed in to change notification settings - Fork 73
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -55,6 +55,9 @@ pub struct VaultTransactionExecute { | |||||
|
|
||||||
| #[arg(long)] | ||||||
| extra_keypair: Option<String>, | ||||||
|
|
||||||
| #[arg(long)] | ||||||
| fee_payer_keypair: Option<String>, | ||||||
| } | ||||||
|
|
||||||
| impl VaultTransactionExecute { | ||||||
|
|
@@ -68,6 +71,7 @@ impl VaultTransactionExecute { | |||||
| priority_fee_lamports, | ||||||
| compute_unit_limit, | ||||||
| extra_keypair, | ||||||
| fee_payer_keypair, | ||||||
| } = self; | ||||||
|
|
||||||
| let program_id = | ||||||
|
|
@@ -90,6 +94,9 @@ impl VaultTransactionExecute { | |||||
| let transaction_extra_signer_keypair = | ||||||
| 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()); | ||||||
|
||||||
| 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")); |
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.