Skip to content

Commit

Permalink
feat(instructions): add rent_payer account
Browse files Browse the repository at this point in the history
  • Loading branch information
vovacodes committed Sep 5, 2023
1 parent a46519a commit 0f5dba5
Show file tree
Hide file tree
Showing 26 changed files with 258 additions and 54 deletions.
13 changes: 8 additions & 5 deletions programs/multisig/src/instructions/batch_add_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ pub struct BatchAddTransaction<'info> {
)]
pub multisig: Account<'info, Multisig>,

/// Member of the multisig.
#[account(mut)]
pub member: Signer<'info>,

/// The proposal account associated with the batch.
#[account(
seeds = [
Expand Down Expand Up @@ -53,7 +49,7 @@ pub struct BatchAddTransaction<'info> {
/// `VaultBatchTransaction` account to initialize and add to the `batch`.
#[account(
init,
payer = member,
payer = rent_payer,
space = VaultBatchTransaction::size(args.ephemeral_signers, &args.transaction_message)?,
seeds = [
SEED_PREFIX,
Expand All @@ -67,6 +63,13 @@ pub struct BatchAddTransaction<'info> {
)]
pub transaction: Account<'info, VaultBatchTransaction>,

/// Member of the multisig.
pub member: Signer<'info>,

/// The payer for the batch transaction account rent.
#[account(mut)]
pub rent_payer: Signer<'info>,

pub system_program: Program<'info, System>,
}

Expand Down
12 changes: 8 additions & 4 deletions programs/multisig/src/instructions/batch_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@ pub struct BatchCreate<'info> {
)]
pub multisig: Account<'info, Multisig>,

#[account(mut)]
pub creator: Signer<'info>,

#[account(
init,
payer = creator,
payer = rent_payer,
space = 8 + Batch::INIT_SPACE,
seeds = [
SEED_PREFIX,
Expand All @@ -36,6 +33,13 @@ pub struct BatchCreate<'info> {
)]
pub batch: Account<'info, Batch>,

/// The member of the multisig that is creating the batch.
pub creator: Signer<'info>,

/// The payer for the batch account rent.
#[account(mut)]
pub rent_payer: Signer<'info>,

pub system_program: Program<'info, System>,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct ConfigTransactionCreate<'info> {

#[account(
init,
payer = creator,
payer = rent_payer,
space = ConfigTransaction::size(&args.actions),
seeds = [
SEED_PREFIX,
Expand All @@ -33,9 +33,13 @@ pub struct ConfigTransactionCreate<'info> {
)]
pub transaction: Account<'info, ConfigTransaction>,

#[account(mut)]
/// The member of the multisig that is creating the transaction.
pub creator: Signer<'info>,

/// The payer for the transaction account rent.
#[account(mut)]
pub rent_payer: Signer<'info>,

pub system_program: Program<'info, System>,
}

Expand Down
8 changes: 6 additions & 2 deletions programs/multisig/src/instructions/proposal_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct ProposalCreate<'info> {

#[account(
init,
payer = creator,
payer = rent_payer,
space = Proposal::size(multisig.members.len()),
seeds = [
SEED_PREFIX,
Expand All @@ -35,9 +35,13 @@ pub struct ProposalCreate<'info> {
)]
pub proposal: Account<'info, Proposal>,

#[account(mut)]
/// The member of the multisig that is creating the proposal.
pub creator: Signer<'info>,

/// The payer for the proposal account rent.
#[account(mut)]
pub rent_payer: Signer<'info>,

pub system_program: Program<'info, System>,
}

Expand Down
10 changes: 7 additions & 3 deletions programs/multisig/src/instructions/vault_transaction_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ pub struct VaultTransactionCreate<'info> {
)]
pub multisig: Account<'info, Multisig>,

#[account(
#[account(
init,
payer = creator,
payer = rent_payer,
space = VaultTransaction::size(args.ephemeral_signers, &args.transaction_message)?,
seeds = [
SEED_PREFIX,
Expand All @@ -38,9 +38,13 @@ pub struct VaultTransactionCreate<'info> {
)]
pub transaction: Account<'info, VaultTransaction>,

#[account(mut)]
/// The member of the multisig that is creating the transaction.
pub creator: Signer<'info>,

/// The payer for the transaction account rent.
#[account(mut)]
pub rent_payer: Signer<'info>,

pub system_program: Program<'info, System>,
}

Expand Down
82 changes: 67 additions & 15 deletions sdk/multisig/idl/multisig.json
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,19 @@
},
{
"name": "creator",
"isMut": false,
"isSigner": true,
"docs": [
"The member of the multisig that is creating the transaction."
]
},
{
"name": "rentPayer",
"isMut": true,
"isSigner": true
"isSigner": true,
"docs": [
"The payer for the transaction account rent."
]
},
{
"name": "systemProgram",
Expand Down Expand Up @@ -445,8 +456,19 @@
},
{
"name": "creator",
"isMut": false,
"isSigner": true,
"docs": [
"The member of the multisig that is creating the transaction."
]
},
{
"name": "rentPayer",
"isMut": true,
"isSigner": true
"isSigner": true,
"docs": [
"The payer for the transaction account rent."
]
},
{
"name": "systemProgram",
Expand Down Expand Up @@ -511,14 +533,25 @@
"isSigner": false
},
{
"name": "creator",
"name": "batch",
"isMut": true,
"isSigner": true
"isSigner": false
},
{
"name": "batch",
"name": "creator",
"isMut": false,
"isSigner": true,
"docs": [
"The member of the multisig that is creating the batch."
]
},
{
"name": "rentPayer",
"isMut": true,
"isSigner": false
"isSigner": true,
"docs": [
"The payer for the batch account rent."
]
},
{
"name": "systemProgram",
Expand Down Expand Up @@ -549,14 +582,6 @@
"Multisig account this batch belongs to."
]
},
{
"name": "member",
"isMut": true,
"isSigner": true,
"docs": [
"Member of the multisig."
]
},
{
"name": "proposal",
"isMut": false,
Expand All @@ -578,6 +603,22 @@
"`VaultBatchTransaction` account to initialize and add to the `batch`."
]
},
{
"name": "member",
"isMut": false,
"isSigner": true,
"docs": [
"Member of the multisig."
]
},
{
"name": "rentPayer",
"isMut": true,
"isSigner": true,
"docs": [
"The payer for the batch transaction account rent."
]
},
{
"name": "systemProgram",
"isMut": false,
Expand Down Expand Up @@ -658,8 +699,19 @@
},
{
"name": "creator",
"isMut": false,
"isSigner": true,
"docs": [
"The member of the multisig that is creating the proposal."
]
},
{
"name": "rentPayer",
"isMut": true,
"isSigner": true
"isSigner": true,
"docs": [
"The payer for the proposal account rent."
]
},
{
"name": "systemProgram",
Expand Down
21 changes: 14 additions & 7 deletions sdk/multisig/src/generated/instructions/batchAddTransaction.ts

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

17 changes: 12 additions & 5 deletions sdk/multisig/src/generated/instructions/batchCreate.ts

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

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

Loading

0 comments on commit 0f5dba5

Please sign in to comment.