Skip to content

Commit

Permalink
remove rent payer PDA
Browse files Browse the repository at this point in the history
  • Loading branch information
brewmaster012 committed Dec 3, 2024
1 parent a92a84f commit 4617aa4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
18 changes: 0 additions & 18 deletions programs/protocol-contracts-solana/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,6 @@ pub mod gateway {
Ok(())
}

pub fn initialize_rent_payer(_ctx: Context<InitializeRentPayer>) -> 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
Expand Down Expand Up @@ -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>,
Expand Down Expand Up @@ -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
Expand Down
18 changes: 0 additions & 18 deletions tests/protocol-contracts-solana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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
Expand Down

0 comments on commit 4617aa4

Please sign in to comment.