Skip to content

Commit

Permalink
make transfer delegate test more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
nhanphan committed Jun 12, 2024
1 parent 858c347 commit ca4b488
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions clients/js/test/plugins/asset/delegateTransfer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
revokePluginAuthority,
} from '../../../src';
import { DEFAULT_ASSET, assertAsset, createUmi } from '../../_setupRaw';
import { createAsset, createAssetWithCollection } from '../../_setupSdk';
import { createAsset, createCollection } from '../../_setupSdk';

test('a delegate can transfer the asset', async (t) => {
const umi = await createUmi();
Expand Down Expand Up @@ -167,9 +167,15 @@ test('it can transfer using delegated update authority from collection', async (
const umi = await createUmi();
const owner = generateSigner(umi);
const newOwner = generateSigner(umi);
const updateAuthority = generateSigner(umi);

const { asset, collection } = await createAssetWithCollection(umi, {
const collection = await createCollection(umi, {
updateAuthority: updateAuthority.publicKey,
});

const asset = await createAsset(umi, {
owner: owner.publicKey,
collection: collection.publicKey,
plugins: [
{
type: 'TransferDelegate',
Expand All @@ -178,12 +184,14 @@ test('it can transfer using delegated update authority from collection', async (
},
},
],
authority: updateAuthority,
});

await transfer(umi, {
asset,
collection,
newOwner: newOwner.publicKey,
authority: updateAuthority,
}).sendAndConfirm(umi);

await assertAsset(t, umi, {
Expand Down

0 comments on commit ca4b488

Please sign in to comment.