From 4617aa4e64a70d15c1c01a285fc87f13d26e1d97 Mon Sep 17 00:00:00 2001 From: brewmaster012 <88689859+brewmaster012@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:13:38 -0600 Subject: [PATCH] remove rent payer PDA --- programs/protocol-contracts-solana/src/lib.rs | 18 ------------------ tests/protocol-contracts-solana.ts | 18 ------------------ 2 files changed, 36 deletions(-) diff --git a/programs/protocol-contracts-solana/src/lib.rs b/programs/protocol-contracts-solana/src/lib.rs index be24f3e..b4d9c00 100644 --- a/programs/protocol-contracts-solana/src/lib.rs +++ b/programs/protocol-contracts-solana/src/lib.rs @@ -167,10 +167,6 @@ pub mod gateway { Ok(()) } - pub fn initialize_rent_payer(_ctx: Context) -> Result<()> { - Ok(()) - } - // deposit SOL into this program and the `receiver` on ZetaChain zEVM // will get corresponding ZRC20 credit. // amount: amount of lamports (10^-9 SOL) to deposit @@ -590,9 +586,6 @@ pub struct WithdrawSPLToken<'info> { #[account(mut)] pub recipient_ata: AccountInfo<'info>, - #[account(mut, seeds = [b"rent-payer"], bump)] - pub rent_payer_pda: Account<'info, RentPayerPda>, - pub token_program: Program<'info, Token>, pub associated_token_program: Program<'info, AssociatedToken>, @@ -676,17 +669,6 @@ pub struct Unwhitelist<'info> { pub system_program: Program<'info, System>, } -#[derive(Accounts)] -pub struct InitializeRentPayer<'info> { - #[account(init, payer = authority, space = 8, seeds = [b"rent-payer"], bump)] - pub rent_payer_pda: Account<'info, RentPayerPda>, - - #[account(mut)] - pub authority: Signer<'info>, - - pub system_program: Program<'info, System>, -} - #[account] pub struct Pda { nonce: u64, // ensure that each signature can only be used once diff --git a/tests/protocol-contracts-solana.ts b/tests/protocol-contracts-solana.ts index fe4345d..f4d985b 100644 --- a/tests/protocol-contracts-solana.ts +++ b/tests/protocol-contracts-solana.ts @@ -126,12 +126,6 @@ describe("Gateway", () => { gatewayProgram.programId, ); - let rentPayerSeeds = [Buffer.from("rent-payer", "utf-8")]; - let [rentPayerPdaAccount] = anchor.web3.PublicKey.findProgramAddressSync( - rentPayerSeeds, - gatewayProgram.programId, - ); - it("Initializes the program", async () => { await gatewayProgram.methods.initialize(tssAddress, chain_id_bn).rpc(); @@ -143,18 +137,6 @@ describe("Gateway", () => { expect(err).to.be.not.null; } }); - it("initialize the rent payer PDA",async() => { - await gatewayProgram.methods.initializeRentPayer().rpc(); - let instr = web3.SystemProgram.transfer({ - fromPubkey: wallet.publicKey, - toPubkey: rentPayerPdaAccount, - lamports: 100000000, - }); - let tx = new web3.Transaction(); - tx.add(instr); - await web3.sendAndConfirmTransaction(conn,tx,[wallet]); - }); - it("Mint a SPL USDC token", async () => { // now deploying a fake USDC SPL Token