Skip to content

Commit

Permalink
use whitelist/unwhitelist across the board
Browse files Browse the repository at this point in the history
  • Loading branch information
brewmaster012 committed Oct 8, 2024
1 parent 1317d1c commit e905e67
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions programs/protocol-contracts-solana/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ pub mod gateway {
}

// whitelisting SPL tokens
pub fn whitelist_spl_mint(_ctx: Context<AddToWhitelist>) -> Result<()> {
pub fn whitelist_spl_mint(_ctx: Context<Whitelist>) -> Result<()> {
Ok(())
}

pub fn de_whitelist_spl_mint(_ctx: Context<DeleteFromWhitelist>) -> Result<()> {
pub fn unwhitelist_spl_mint(_ctx: Context<Unwhitelist>) -> Result<()> {
Ok(())
}

Expand Down Expand Up @@ -429,7 +429,7 @@ pub struct UpdatePaused<'info> {
}

#[derive(Accounts)]
pub struct AddToWhitelist<'info> {
pub struct Whitelist<'info> {
#[account(
init,
space=8,
Expand All @@ -452,7 +452,7 @@ pub struct AddToWhitelist<'info> {
}

#[derive(Accounts)]
pub struct DeleteFromWhitelist<'info> {
pub struct Unwhitelist<'info> {
#[account(
mut,
seeds=[
Expand Down
6 changes: 3 additions & 3 deletions tests/protocol-contracts-solana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {expect} from 'chai';
import {ecdsaRecover} from 'secp256k1';
import {getOrCreateAssociatedTokenAccount} from "@solana/spl-token";


console.log = function() {}

const ec = new EC('secp256k1');
// const keyPair = ec.genKeyPair();
Expand Down Expand Up @@ -412,8 +412,8 @@ describe("some tests", () => {
expect(bal2-bal1).to.be.gte(1_000_000_000);
})

it("de-whitelist SPL token and deposit should fail", async () => {
await gatewayProgram.methods.deWhitelistSplMint().accounts({
it("unwhitelist SPL token and deposit should fail", async () => {
await gatewayProgram.methods.unwhitelistSplMint().accounts({
whitelistCandidate: mint.publicKey,
}).rpc();

Expand Down

0 comments on commit e905e67

Please sign in to comment.