Skip to content

Commit

Permalink
chore: revert manual anchor spl implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
ananas-block committed Jun 27, 2024
1 parent 89d2f7d commit 6a75f55
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 289 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion programs/compressed-token/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ default = ["custom-heap", "idl-build", "cpi-context"]
test-sbf = []
bench-sbf = []
cpi-context = []
idl-build = ["anchor-lang/idl-build"]
idl-build = ["anchor-lang/idl-build", "anchor-spl/idl-build"]



[dependencies]
anchor-lang = "0.29.0"
anchor-spl = "0.29.0"
spl-token = {version = "3.5.0", features = ["no-entrypoint"]}
aligned-sized = { version = "0.2.1", path = "../../macros/aligned-sized" }
account-compression = { version = "0.4.1", path = "../account-compression", features = ["cpi", "no-idl"] }
Expand Down
201 changes: 0 additions & 201 deletions programs/compressed-token/src/anchor_spl.rs

This file was deleted.

55 changes: 0 additions & 55 deletions programs/compressed-token/src/create_mint.rs

This file was deleted.

2 changes: 1 addition & 1 deletion programs/compressed-token/src/instructions/freeze.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::anchor_spl::Mint;
use account_compression::{program::AccountCompression, utils::constants::CPI_AUTHORITY_PDA_SEED};
use anchor_lang::prelude::*;
use anchor_spl::token::Mint;
use light_system_program::sdk::accounts::{InvokeAccounts, SignerAccounts};

#[derive(Accounts)]
Expand Down
2 changes: 1 addition & 1 deletion programs/compressed-token/src/instructions/transfer.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::anchor_spl::{Token, TokenAccount};
use account_compression::{program::AccountCompression, utils::constants::CPI_AUTHORITY_PDA_SEED};
use anchor_lang::prelude::*;
use anchor_spl::token::{Token, TokenAccount};
use light_system_program::{
self,
sdk::accounts::{InvokeAccounts, SignerAccounts},
Expand Down
8 changes: 2 additions & 6 deletions programs/compressed-token/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ pub mod delegation;
pub mod freeze;
pub mod instructions;
pub use instructions::*;
pub mod anchor_spl;
pub mod burn;
pub mod create_mint;

use crate::process_transfer::CompressedTokenInstructionDataTransfer;
declare_id!("HXVfQ44ATEi9WBKLSCCwM54KokdkzqXci9xCQ7ST9SYN");
Expand All @@ -30,24 +28,22 @@ solana_security_txt::security_txt! {
#[program]
pub mod light_compressed_token {

use create_mint::create_token_account;

use super::*;

/// This instruction expects a mint account to be created in a separate
/// token program instruction with token authority as mint authority. This
/// instruction creates a token pool account for that mint owned by token
/// authority.
pub fn create_token_pool<'info>(
ctx: Context<'_, '_, '_, 'info, CreateTokenPoolInstruction<'info>>,
_ctx: Context<'_, '_, '_, 'info, CreateTokenPoolInstruction<'info>>,
) -> Result<()> {
// let token_pool = &mut ctx.accounts.token_pool_pda;
// if token_pool.mint != ctx.accounts.mint.key() {
// return err!(crate::ErrorCode::InvalidMint);
// }
// token_pool.mint = ctx.accounts.mint.key();
// token_pool.owner = ctx.accounts.cpi_authority_pda.key();
create_token_account(ctx)?;
// create_token_account(ctx)?;
Ok(())
}

Expand Down
Loading

0 comments on commit 6a75f55

Please sign in to comment.