Skip to content

Commit 1f1357e

Browse files
committed
fix: test update and remove nft type utxo
1 parent dcc9e69 commit 1f1357e

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

packages/sdk/src/mintlayer-connect-sdk.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -671,21 +671,21 @@ class Client {
671671
*/
672672
private selectUTXOs(utxos: UtxoEntry[], amount: bigint, token_id: string | null): UtxoInput[] {
673673
const transferableUtxoTypes = ['Transfer', 'LockThenTransfer', 'IssueNft'];
674-
const filteredUtxos: UtxoEntry[] = utxos
674+
const filteredUtxos: any[] = utxos // type fix for NFT considering that NFT don't have amount
675675
.map((utxo) => {
676676
if (utxo.utxo.type === 'IssueNft') {
677677
return {
678678
...utxo,
679679
utxo: {
680680
...utxo.utxo,
681-
// value: {
682-
// amount: {
683-
// atoms: 1,
684-
// decimal: 1,
685-
// },
686-
// type: 'TokenV1',
687-
// token_id: utxo.utxo.token_id,
688-
// },
681+
value: {
682+
amount: {
683+
atoms: 1,
684+
decimal: 1,
685+
},
686+
type: 'TokenV1',
687+
token_id: utxo.utxo.token_id,
688+
},
689689
},
690690
};
691691
} else {
Binary file not shown.

packages/sdk/tests/transfer-nft.test.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,8 @@ test('buildTransaction for transfer NFT using normal utxo - snapshot', async ()
185185

186186
const result = await spy.mock.results[0]?.value;
187187

188-
console.log(JSON.stringify(result, null, 2));
189-
190-
// expect(result).toMatchSnapshot();
188+
expect(result).toMatchSnapshot();
189+
spy.mockRestore();
191190
});
192191

193192
test('buildTransaction for transfer NFT using initial issue utxo - snapshot', async () => {
@@ -204,7 +203,6 @@ test('buildTransaction for transfer NFT using initial issue utxo - snapshot', as
204203

205204
const result = await spy.mock.results[0]?.value;
206205

207-
console.log(JSON.stringify(result, null, 2));
208-
209-
// expect(result).toMatchSnapshot();
206+
expect(result).toMatchSnapshot();
207+
spy.mockRestore();
210208
});

0 commit comments

Comments
 (0)