diff --git a/test/services/ckb.test.ts b/test/services/ckb.test.ts index b228aef0..44df7a81 100644 --- a/test/services/ckb.test.ts +++ b/test/services/ckb.test.ts @@ -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', @@ -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');