Skip to content
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

Set owners and change threshold atomically #5

Merged
merged 1 commit into from
Aug 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions programs/multisig/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,19 @@ pub mod multisig {
Ok(())
}

// Set owners and threshold at once.
pub fn set_owners_and_change_threshold<'info>(
ctx: Context<'_, '_, '_, 'info, Auth<'info>>,
owners: Vec<Pubkey>,
threshold: u64,
) -> Result<()> {
set_owners(
Context::new(ctx.program_id, ctx.accounts, ctx.remaining_accounts),
owners,
)?;
change_threshold(ctx, threshold)
}

// Sets the owners field on the multisig. The only way this can be invoked
// is via a recursive call from execute_transaction -> set_owners.
pub fn set_owners(ctx: Context<Auth>, owners: Vec<Pubkey>) -> Result<()> {
Expand Down