Skip to content

Commit

Permalink
use ocp program id in ocp cpi calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Vanderwaal committed Jan 8, 2024
1 parent 144096b commit 80bb52a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ program = "tests/deps/mpl_migration_validator.so" # custom migration valid
mmm = "mmm3XBJg5gk8XJxEKBvdgptZz6SgK4tXvn36sodowMc"

[scripts]
test = "npx ts-mocha -p ./tsconfig.json -t 1000000 tests/mmm-ocp.spec.ts"
test = "npx ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.spec.ts"

[toolchain]
anchor = "0.29.0"
Expand Down
2 changes: 1 addition & 1 deletion programs/mmm/src/instructions/ocp/ocp_deposit_sell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub fn handler(ctx: Context<OcpDepositSell>, args: DepositSellArgs) -> Result<()

if asset_token_account.amount == args.asset_amount {
open_creator_protocol::cpi::close(CpiContext::new(
ctx.accounts.cmt_program.to_account_info(),
ctx.accounts.ocp_program.to_account_info(),
open_creator_protocol::cpi::accounts::CloseCtx {
policy: ctx.accounts.ocp_policy.to_account_info(),
freeze_authority: ctx.accounts.ocp_freeze_authority.to_account_info(),
Expand Down
2 changes: 1 addition & 1 deletion programs/mmm/src/instructions/ocp/ocp_withdraw_sell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ pub fn handler(ctx: Context<OcpWithdrawSell>, args: WithdrawSellArgs) -> Result<
// we can close the sellside_escrow_token_account if no amount left
if sellside_escrow_token_account.amount == args.asset_amount {
open_creator_protocol::cpi::close(CpiContext::new_with_signer(
ctx.accounts.cmt_program.to_account_info(),
ctx.accounts.ocp_program.to_account_info(),
open_creator_protocol::cpi::accounts::CloseCtx {
policy: ctx.accounts.ocp_policy.to_account_info(),
freeze_authority: ctx.accounts.ocp_freeze_authority.to_account_info(),
Expand Down
2 changes: 1 addition & 1 deletion programs/mmm/src/instructions/ocp/sol_ocp_fulfill_buy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ pub fn handler<'info>(
// we can close the payer_asset_account if no amount left
if payer_asset_account.amount == args.asset_amount {
open_creator_protocol::cpi::close(CpiContext::new(
ctx.accounts.cmt_program.to_account_info(),
ctx.accounts.ocp_program.to_account_info(),
open_creator_protocol::cpi::accounts::CloseCtx {
policy: ocp_policy.to_account_info(),
freeze_authority: ctx.accounts.ocp_freeze_authority.to_account_info(),
Expand Down
2 changes: 1 addition & 1 deletion programs/mmm/src/instructions/ocp/sol_ocp_fulfill_sell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ pub fn handler<'info>(
// we can close the sellside_escrow_token_account if no amount left
if sellside_escrow_token_account.amount == args.asset_amount {
open_creator_protocol::cpi::close(CpiContext::new_with_signer(
ctx.accounts.cmt_program.to_account_info(),
ctx.accounts.ocp_program.to_account_info(),
open_creator_protocol::cpi::accounts::CloseCtx {
policy: ocp_policy.to_account_info(),
freeze_authority: ctx.accounts.ocp_freeze_authority.to_account_info(),
Expand Down
2 changes: 1 addition & 1 deletion tests/mmm-ocp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('mmm-ocp', () => {
await airdrop(connection, wallet.publicKey, 50);
});

it.only('can deposit and withdraw ocp NFTs - happy path', async () => {
it('can deposit and withdraw ocp NFTs - happy path', async () => {
const creator = Keypair.generate();
const nftRes = await createTestMintAndTokenOCP(
connection,
Expand Down

0 comments on commit 80bb52a

Please sign in to comment.