From 136d04e78c6b62a38881656704fa9a4a861c2494 Mon Sep 17 00:00:00 2001 From: Promethea Raschke Date: Mon, 31 Jul 2023 19:06:41 +0100 Subject: [PATCH] Remove second signers from adding minter and guardian --- .../solana/programs/tbtc/src/processor/admin/add_guardian.rs | 3 ++- .../solana/programs/tbtc/src/processor/admin/add_minter.rs | 3 ++- cross-chain/solana/tests/01__tbtc.ts | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cross-chain/solana/programs/tbtc/src/processor/admin/add_guardian.rs b/cross-chain/solana/programs/tbtc/src/processor/admin/add_guardian.rs index ccce8f25b..cd79f2d5e 100644 --- a/cross-chain/solana/programs/tbtc/src/processor/admin/add_guardian.rs +++ b/cross-chain/solana/programs/tbtc/src/processor/admin/add_guardian.rs @@ -12,7 +12,8 @@ pub struct AddGuardian<'info> { )] pub tbtc: Account<'info, Tbtc>, pub authority: Signer<'info>, - pub guardian: Signer<'info>, + /// CHECK: the guardian does not need to sign + pub guardian: UncheckedAccount<'info>, #[account(mut)] pub payer: Signer<'info>, #[account( diff --git a/cross-chain/solana/programs/tbtc/src/processor/admin/add_minter.rs b/cross-chain/solana/programs/tbtc/src/processor/admin/add_minter.rs index 82db6f436..f263dafe6 100644 --- a/cross-chain/solana/programs/tbtc/src/processor/admin/add_minter.rs +++ b/cross-chain/solana/programs/tbtc/src/processor/admin/add_minter.rs @@ -12,7 +12,8 @@ pub struct AddMinter<'info> { )] pub tbtc: Account<'info, Tbtc>, pub authority: Signer<'info>, - pub minter: Signer<'info>, + /// CHECK: the minter does not need to sign + pub minter: UncheckedAccount<'info>, #[account(mut)] pub payer: Signer<'info>, #[account( diff --git a/cross-chain/solana/tests/01__tbtc.ts b/cross-chain/solana/tests/01__tbtc.ts index 53e71e1da..f5976b7e1 100644 --- a/cross-chain/solana/tests/01__tbtc.ts +++ b/cross-chain/solana/tests/01__tbtc.ts @@ -122,7 +122,7 @@ async function addMinter( payer: payer.publicKey, minterInfo: minterInfoPDA, }) - .signers(maybeAuthorityAnd(authority, [minter])) + .signers(maybeAuthorityAnd(authority, [])) .rpc(); return minterInfoPDA; } @@ -189,7 +189,7 @@ async function addGuardian( payer: payer.publicKey, guardianInfo: guardianInfoPDA, }) - .signers(maybeAuthorityAnd(authority, [guardian])) + .signers(maybeAuthorityAnd(authority, [])) .rpc(); return guardianInfoPDA; }