Skip to content

Commit

Permalink
add tree+leaf_index test
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkSackerberg committed Jan 25, 2025
1 parent e70c453 commit ec3c76a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions clients/js/test/getAssetSignatures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,30 @@ DAS_API_ENDPOINTS.forEach((endpoint) => {
slot: 356098214,
});
});

test(`it can fetch the signatures of a compressed asset by leaf index and tree (${endpoint.name})`, async (t) => {
// Given a minted NFT on mainnet.
const umi = createUmi(endpoint.url);
const tree = publicKey('J1imb8C8SPzofrtgCxkN4nsKwHevzxgvHGeYBKFEDEmE');
const leaf_index = 0;
// When we fetch the Signatures for the asset.
const signatures = await umi.rpc.getAssetSignatures({ tree, leaf_index });

// Then we expect to find 2 signatures.
t.is(signatures.total, 2);
t.is(signatures.limit, 1000);
t.is(signatures.items.length, 2);
t.like(signatures.items[0], <DasApiTransactionSignature>{
signature:
'3Ki9QJTC2V1oNhkkhvJAJ4DEBRdMMrvKqctsyPhGL5JGkZz72xAsgTQh4vAEuJNtkxTxdmWg7RhkSXwU2JNRdSVh',
instruction: 'MintToCollectionV1',
slot: 356098299,
});
t.like(signatures.items[1], <DasApiTransactionSignature>{
signature:
'4rNhZukEBfuGxWxesRgStu1PqvStycu1fhNiftXVUcCygazXLpz6BubNCMywBW9eQLKtLa58FSqgyjDxHSTuFYy8',
instruction: 'CreateTree',
slot: 356098214,
});
});
});

0 comments on commit ec3c76a

Please sign in to comment.