Skip to content

Commit

Permalink
Lookup table config (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
juchiast authored Nov 21, 2024
1 parent 70e4872 commit dfc9466
Show file tree
Hide file tree
Showing 96 changed files with 168 additions and 12 deletions.
37 changes: 36 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/cmds-solana/src/associated_token_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {

let instructions = if input.submit {
Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer].into(),
instructions: [instruction].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/compression/burn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
.instruction();

let ins = Instructions {
lookup_tables: None,
fee_payer: input.payer.pubkey(),
signers: [input.payer, signer].into(),
instructions: [ix].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/compression/create_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
.instruction();

let ins = Instructions {
lookup_tables: None,
fee_payer: input.payer.pubkey(),
signers: [input.payer, input.creator, input.merkle_tree].into(),
instructions: [create_merkle_account_ix, create_tree_config_ix].into(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
.instruction();

let ins = Instructions {
lookup_tables: None,
fee_payer: input.payer.pubkey(),
signers: [
input.payer,
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/compression/mint_v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
.instruction();

let ins = Instructions {
lookup_tables: None,
fee_payer: input.payer.pubkey(),
signers: [input.payer, input.creator_or_delegate].into(),
instructions: [mint_ix].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/compression/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
.instruction();

let ins = Instructions {
lookup_tables: None,
fee_payer: input.payer.pubkey(),
signers: [input.payer, signer].into(),
instructions: [mint_ix].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/compression/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
};

let ins = Instructions {
lookup_tables: None,
fee_payer: input.payer.pubkey(),
signers: [input.payer, input.authority].into(),
instructions: [ix].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/create_mint_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
.into();

let ins = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.mint_authority, input.mint_account].into(),
instructions,
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/create_token_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {

let instructions = if input.submit {
Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.token_account].into(),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.governance].into(),
instructions: [ix].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/governance/add_signatory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: std::iter::once(input.fee_payer)
.chain(input.governance_authority)
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/governance/cancel_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.governance_authority].into(),
instructions: [ix].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/governance/cast_vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.governance_authority].into(),
instructions: [ix].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/governance/complete_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.complete_proposal_authority].into(),
instructions: [ix].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/governance/create_governance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.create_authority].into(),
instructions: [ix].into(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
create_native_treasury(&program_id, &input.governance, &input.fee_payer.pubkey());

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer].into(),
instructions: [ix].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/governance/create_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.governance_authority].into(),
instructions: [ix].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/governance/create_realm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer].into(),
instructions: [ix].into(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer].into(),
instructions: [ix].into(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [
input.fee_payer,
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/governance/execute_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
.collect();

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers,
instructions: [ix].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/governance/finalize_vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer].into(),
instructions: [ix].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/governance/insert_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.governance_authority].into(),
instructions: [ix].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/governance/post_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [
input.fee_payer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
refund_proposal_deposit(&program_id, &input.proposal, &input.proposal_deposit_payer);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer].into(),
instructions: [ix].into(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: std::iter::once(input.fee_payer)
.chain(input.token_owner_record_lock_authority)
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/governance/relinquish_vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: std::iter::once(input.fee_payer)
.chain(input.governance_authority)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.governance].into(),
instructions: [ix].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/governance/remove_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.governance_authority].into(),
instructions: [ix].into(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.revoke_authority].into(),
instructions: [ix].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/governance/set_governance_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
let ix = set_governance_config(&program_id, &input.governance.pubkey(), input.config);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.governance].into(),
instructions: [ix].into(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.governance_authority].into(),
instructions: [ix].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/governance/set_realm_authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.realm_authority].into(),
instructions: [ix].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/governance/set_realm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.realm_authority].into(),
instructions: [ix].into(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.token_owner_record_lock_authority].into(),
instructions: [ix].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/governance/sign_off_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.signatory].into(),
instructions: [ix].into(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
);

let instructions = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.governing_token_owner].into(),
instructions: [ix].into(),
Expand Down
2 changes: 1 addition & 1 deletion crates/cmds-solana/src/jupiter/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pub mod swap;
pub mod swap;
1 change: 1 addition & 0 deletions crates/cmds-solana/src/jupiter/swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
// instructions.extend(swap_instructions.cleanup_instruction);

let ins = Instructions {
lookup_tables: Some(swap_instructions.address_lookup_table_addresses),
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer].into(),
instructions: instructions.into(),

Check warning on line 114 in crates/cmds-solana/src/jupiter/swap.rs

View workflow job for this annotation

GitHub Actions / clippy

useless conversion to the same type: `std::vec::Vec<solana_sdk::instruction::Instruction>`

warning: useless conversion to the same type: `std::vec::Vec<solana_sdk::instruction::Instruction>` --> crates/cmds-solana/src/jupiter/swap.rs:114:23 | 114 | instructions: instructions.into(), | ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `instructions` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion = note: `#[warn(clippy::useless_conversion)]` on by default

Check warning on line 114 in crates/cmds-solana/src/jupiter/swap.rs

View workflow job for this annotation

GitHub Actions / clippy

useless conversion to the same type: `std::vec::Vec<solana_sdk::instruction::Instruction>`

warning: useless conversion to the same type: `std::vec::Vec<solana_sdk::instruction::Instruction>` --> crates/cmds-solana/src/jupiter/swap.rs:114:23 | 114 | instructions: instructions.into(), | ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `instructions` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion = note: `#[warn(clippy::useless_conversion)]` on by default
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/memo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
let instruction = spl_memo::build_memo(input.memo.as_bytes(), &[&input.fee_payer.pubkey()]);

let ins = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer].into(),
instructions: [instruction].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/mint_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {
)?;

let ins = Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.mint_authority].into(),
instructions: [instruction].into(),
Expand Down
1 change: 1 addition & 0 deletions crates/cmds-solana/src/nft/approve_collection_authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ async fn run(mut ctx: Context, input: Input) -> Result<Output, CommandError> {

let instructions = if input.submit {
Instructions {
lookup_tables: None,
fee_payer: input.fee_payer.pubkey(),
signers: [input.fee_payer, input.update_authority].into(),
minimum_balance_for_rent_exemption,
Expand Down
Loading

0 comments on commit dfc9466

Please sign in to comment.