Skip to content

Commit

Permalink
test: add test for CKBClient.getInfoCellData
Browse files Browse the repository at this point in the history
  • Loading branch information
Flouse committed Jul 27, 2024
1 parent f412239 commit 843441d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/services/ckb.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ describe('CKBClient', () => {
hashType: 'type',
};

// {"name":"tUTXO","symbol":"tUTXO","decimal":8}
const tUtxoTypeScript: Script = {
codeHash: '0x25c29dc317811a6f6f3985a7a9ebc4838bd388d19d0feeecf0bcd60f6c0975bb',
args: '0x92b419a8d8e03c683a47b960f707f2b866f6114b70327b6628762719b243c5ca',
hashType: 'type',
};

// CKBI
const inscriptionTypeScript: Script = {
codeHash: '0x25c29dc317811a6f6f3985a7a9ebc4838bd388d19d0feeecf0bcd60f6c0975bb',
Expand Down Expand Up @@ -51,6 +58,17 @@ describe('CKBClient', () => {
});
});

test('getInfoCellData: should return the info cell data', async () => {
// related tx:
// https://pudge.explorer.nervos.org/transaction/0x38f88df8b0ce98ec0dee86249c8640b06439105a2500b4ca0638a1a229a52a48
const infoCellData = await ckb.getInfoCellData(tUtxoTypeScript);
expect(infoCellData).toEqual({
decimal: 8,
name: 'tUTXO',
symbol: 'tUTXO',
});
});

test('getInscriptionCellData: should return the inscription cell data (before rebase)', async () => {
// CKBI (Inscription cell transaction)
const tx = await ckb.rpc.getTransaction('0xd1195131f13eca1b4ec1c4b58f7a16f27a239b1064270d703d0c3eb5b6c1b332');
Expand Down

0 comments on commit 843441d

Please sign in to comment.