Changeset View
Changeset View
Standalone View
Standalone View
modules/chronik-client/test/integration/token_alp.ts
// Copyright (c) 2024 The Bitcoin developers | // Copyright (c) 2024 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
import * as chai from 'chai'; | import * as chai from 'chai'; | ||||
import chaiAsPromised from 'chai-as-promised'; | import chaiAsPromised from 'chai-as-promised'; | ||||
import { ChildProcess } from 'node:child_process'; | import { ChildProcess } from 'node:child_process'; | ||||
import { EventEmitter, once } from 'node:events'; | import { EventEmitter, once } from 'node:events'; | ||||
import { | import { | ||||
ChronikClientNode, | ChronikClientNode, | ||||
TokenInfo, | |||||
Token_InNode, | Token_InNode, | ||||
TxHistoryPage_InNode, | TxHistoryPage_InNode, | ||||
Tx_InNode, | Tx_InNode, | ||||
} from '../../index'; | } from '../../index'; | ||||
import initializeTestRunner from '../setup/testRunner'; | import initializeTestRunner from '../setup/testRunner'; | ||||
const expect = chai.expect; | const expect = chai.expect; | ||||
chai.use(chaiAsPromised); | chai.use(chaiAsPromised); | ||||
describe('Get blocktxs, txs, and history for ALP token txs', () => { | describe('Get blocktxs, txs, and history for ALP token txs', () => { | ||||
let testRunner: ChildProcess; | let testRunner: ChildProcess; | ||||
let chronik_url: Promise<Array<string>>; | let chronik_url: Promise<Array<string>>; | ||||
let get_alp_genesis_txid: Promise<string>; | let get_alp_genesis_txid: Promise<string>; | ||||
let get_alp_mint_txid: Promise<string>; | let get_alp_mint_txid: Promise<string>; | ||||
let get_alp_send_txid: Promise<string>; | let get_alp_send_txid: Promise<string>; | ||||
let get_alp_genesis2_txid: Promise<string>; | let get_alp_genesis2_txid: Promise<string>; | ||||
let get_alp_multi_txid: Promise<string>; | let get_alp_multi_txid: Promise<string>; | ||||
let get_alp_mega_txid: Promise<string>; | let get_alp_mega_txid: Promise<string>; | ||||
let get_alp_mint_two_txid: Promise<string>; | let get_alp_mint_two_txid: Promise<string>; | ||||
let get_alp_send_two_txid: Promise<string>; | let get_alp_nonutf8_genesis_txid: Promise<string>; | ||||
const statusEvent = new EventEmitter(); | const statusEvent = new EventEmitter(); | ||||
before(async () => { | before(async () => { | ||||
testRunner = initializeTestRunner('chronik-client_token_alp'); | testRunner = initializeTestRunner('chronik-client_token_alp'); | ||||
testRunner.on('message', function (message: any) { | testRunner.on('message', function (message: any) { | ||||
if (message && message.chronik) { | if (message && message.chronik) { | ||||
console.log('Setting chronik url to ', message.chronik); | console.log('Setting chronik url to ', message.chronik); | ||||
Show All 38 Lines | before(async () => { | ||||
} | } | ||||
if (message && message.alp_mint_two_txid) { | if (message && message.alp_mint_two_txid) { | ||||
get_alp_mint_two_txid = new Promise(resolve => { | get_alp_mint_two_txid = new Promise(resolve => { | ||||
resolve(message.alp_mint_two_txid); | resolve(message.alp_mint_two_txid); | ||||
}); | }); | ||||
} | } | ||||
if (message && message.alp_send_two_txid) { | if (message && message.alp_nonutf8_genesis_txid) { | ||||
get_alp_send_two_txid = new Promise(resolve => { | get_alp_nonutf8_genesis_txid = new Promise(resolve => { | ||||
resolve(message.alp_send_two_txid); | resolve(message.alp_nonutf8_genesis_txid); | ||||
}); | }); | ||||
} | } | ||||
if (message && message.status) { | if (message && message.status) { | ||||
statusEvent.emit(message.status); | statusEvent.emit(message.status); | ||||
} | } | ||||
}); | }); | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | describe('Get blocktxs, txs, and history for ALP token txs', () => { | ||||
}; | }; | ||||
let alpGenesisTxid = ''; | let alpGenesisTxid = ''; | ||||
let alpMintTxid = ''; | let alpMintTxid = ''; | ||||
let alpSendTxid = ''; | let alpSendTxid = ''; | ||||
let alpNextGenesisTxid = ''; | let alpNextGenesisTxid = ''; | ||||
let alpMultiTxid = ''; | let alpMultiTxid = ''; | ||||
let alpMegaTxid = ''; | let alpMegaTxid = ''; | ||||
let alpMintTwoTxid = ''; | let alpMintTwoTxid = ''; | ||||
let alpSendTwoTxid = ''; | let alpNonUtf8GenesisTxid = ''; | ||||
let alpGenesis: Tx_InNode; | let alpGenesis: Tx_InNode; | ||||
let alpMint: Tx_InNode; | let alpMint: Tx_InNode; | ||||
let alpSend: Tx_InNode; | let alpSend: Tx_InNode; | ||||
let alpNextGenesis: Tx_InNode; | let alpNextGenesis: Tx_InNode; | ||||
let alpMulti: Tx_InNode; | let alpMulti: Tx_InNode; | ||||
let alpMega: Tx_InNode; | let alpMega: Tx_InNode; | ||||
let alpMintTwo: Tx_InNode; | let alpMintTwo: Tx_InNode; | ||||
let alpSendTwo: Tx_InNode; | let alpSendTwo: Tx_InNode; | ||||
const alpTokenInfo: TokenInfo = { | |||||
tokenId: | |||||
'1111111111111111111111111111111111111111111111111111111111111111', | |||||
timeFirstSeen: '1300000000', | |||||
tokenType: { | |||||
protocol: 'ALP', | |||||
type: 'ALP_TOKEN_TYPE_STANDARD', | |||||
number: 0, | |||||
}, | |||||
// We do not get hash in GenesisInfo for ALP | |||||
// We get data and authPubkey keys in GenesisInfo for ALP | |||||
// We do not get mintVaultScripthash for non-SLP_MINT_VAULT | |||||
genesisInfo: { | |||||
tokenTicker: 'TEST', | |||||
tokenName: 'Test Token', | |||||
url: 'http://example.com', | |||||
data: new Uint8Array([84, 111, 107, 101, 110, 32, 68, 97, 116, 97]), | |||||
authPubkey: '546f6b656e205075626b6579', | |||||
decimals: 4, | |||||
}, | |||||
}; | |||||
let confirmedTxsForAlpGenesisTxid: TxHistoryPage_InNode; | let confirmedTxsForAlpGenesisTxid: TxHistoryPage_InNode; | ||||
it('Gets an ALP genesis tx from the mempool', async () => { | it('Gets an ALP genesis tx from the mempool', async () => { | ||||
const chronikUrl = await chronik_url; | const chronikUrl = await chronik_url; | ||||
const chronik = new ChronikClientNode(chronikUrl); | const chronik = new ChronikClientNode(chronikUrl); | ||||
alpGenesisTxid = await get_alp_genesis_txid; | alpGenesisTxid = await get_alp_genesis_txid; | ||||
▲ Show 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | it('Gets an ALP genesis tx from the mempool', async () => { | ||||
expect(confirmedTxsForThisTokenId.txs.length).to.eql(0); | expect(confirmedTxsForThisTokenId.txs.length).to.eql(0); | ||||
// History returns the output of confirmed + unconfirmed (in this case, just unconfirmed) | // History returns the output of confirmed + unconfirmed (in this case, just unconfirmed) | ||||
const historyForThisTokenId = await chronik | const historyForThisTokenId = await chronik | ||||
.tokenId(alpGenesisTxid) | .tokenId(alpGenesisTxid) | ||||
.history(); | .history(); | ||||
expect(historyForThisTokenId.txs.length).to.eql(1); | expect(historyForThisTokenId.txs.length).to.eql(1); | ||||
expect(historyForThisTokenId.txs[0]).to.deep.equal(alpGenesis); | expect(historyForThisTokenId.txs[0]).to.deep.equal(alpGenesis); | ||||
// We can get token info of an alp token from the mempool | |||||
const alpGenesisMempoolInfo = await chronik.token(alpGenesisTxid); | |||||
expect(alpGenesisMempoolInfo).to.deep.equal({ | |||||
...alpTokenInfo, | |||||
tokenId: alpGenesisTxid, | |||||
}); | |||||
// Invalid tokenId is rejected | |||||
await expect(chronik.token('somestring')).to.be.rejectedWith( | |||||
Error, | |||||
`Failed getting /token/somestring (): 400: Not a txid: somestring`, | |||||
); | |||||
// We get expected error for a txid that is not in the mempool | |||||
await expect( | |||||
chronik.token( | |||||
'0dab1008db30343a4f771983e9fd96cbc15f0c6efc73f5249c9bae311ef1e92f', | |||||
), | |||||
).to.be.rejectedWith( | |||||
Error, | |||||
`Failed getting /token/0dab1008db30343a4f771983e9fd96cbc15f0c6efc73f5249c9bae311ef1e92f (): 404: Token 0dab1008db30343a4f771983e9fd96cbc15f0c6efc73f5249c9bae311ef1e92f not found in the index`, | |||||
); | |||||
}); | }); | ||||
it('Gets an ALP mint tx from the mempool', async () => { | it('Gets an ALP mint tx from the mempool', async () => { | ||||
const chronikUrl = await chronik_url; | const chronikUrl = await chronik_url; | ||||
const chronik = new ChronikClientNode(chronikUrl); | const chronik = new ChronikClientNode(chronikUrl); | ||||
// We can get an alp mint tx from the mempool | // We can get an alp mint tx from the mempool | ||||
alpMintTxid = await get_alp_mint_txid; | alpMintTxid = await get_alp_mint_txid; | ||||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | it('Gets an ALP mint tx from the mempool', async () => { | ||||
}, | }, | ||||
]); | ]); | ||||
// The token did not fail parsings | // The token did not fail parsings | ||||
expect(alpMint.tokenFailedParsings).to.deep.equal([]); | expect(alpMint.tokenFailedParsings).to.deep.equal([]); | ||||
// Normal status | // Normal status | ||||
expect(alpMint.tokenStatus).to.eql('TOKEN_STATUS_NORMAL'); | expect(alpMint.tokenStatus).to.eql('TOKEN_STATUS_NORMAL'); | ||||
// Error is thrown for a txid that is in the mempool but is not a tokenId | |||||
await expect(chronik.token(alpMintTxid)).to.be.rejectedWith( | |||||
Error, | |||||
`Failed getting /token/0dab1008db30343a4f771983e9fd96cbc15f0c6efc73f5249c9bae311ef1e92f (): 404: Token 0dab1008db30343a4f771983e9fd96cbc15f0c6efc73f5249c9bae311ef1e92f not found in the index`, | |||||
); | |||||
}); | }); | ||||
it('Gets an ALP send tx from the mempool', async () => { | it('Gets an ALP send tx from the mempool', async () => { | ||||
const chronikUrl = await chronik_url; | const chronikUrl = await chronik_url; | ||||
const chronik = new ChronikClientNode(chronikUrl); | const chronik = new ChronikClientNode(chronikUrl); | ||||
// We can get an alp send tx from the mempool | // We can get an alp send tx from the mempool | ||||
alpSendTxid = await get_alp_send_txid; | alpSendTxid = await get_alp_send_txid; | ||||
▲ Show 20 Lines • Show All 328 Lines • ▼ Show 20 Lines | it('Gets an ALP genesis, mint, and send (also a burn) combo tx from the mempool', async () => { | ||||
reverseAlphabeticalBroadcastAlpGenesisMempoolTxs[i], | reverseAlphabeticalBroadcastAlpGenesisMempoolTxs[i], | ||||
); | ); | ||||
} | } | ||||
}); | }); | ||||
it('Can get all of the above txs, and a wild mega-tx, from the blockTxs endpoint after they are mined in a block', async () => { | it('Can get all of the above txs, and a wild mega-tx, from the blockTxs endpoint after they are mined in a block', async () => { | ||||
const chronikUrl = await chronik_url; | const chronikUrl = await chronik_url; | ||||
const chronik = new ChronikClientNode(chronikUrl); | const chronik = new ChronikClientNode(chronikUrl); | ||||
// Now that we have a block, we get a block key from token info | |||||
const alpGenesisConfirmedInfo = await chronik.token(alpGenesisTxid); | |||||
expect(alpGenesisConfirmedInfo).to.deep.equal({ | |||||
...alpTokenInfo, | |||||
tokenId: alpGenesisTxid, | |||||
block: { | |||||
hash: '5e75fc2b2b101c4cf8beec2a68303fcdc5e6d0e3684cc8fbe5ebea60d781b1bb', | |||||
height: 102, | |||||
timestamp: 1300000500, | |||||
}, | |||||
}); | |||||
alpMegaTxid = await get_alp_mega_txid; | alpMegaTxid = await get_alp_mega_txid; | ||||
// Can this one from the tx endpoint | // Can this one from the tx endpoint | ||||
alpMega = await chronik.tx(alpMegaTxid); | alpMega = await chronik.tx(alpMegaTxid); | ||||
// We get expected inputs including expected Token data | // We get expected inputs including expected Token data | ||||
expect(alpMega.inputs).to.deep.equal([ | expect(alpMega.inputs).to.deep.equal([ | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 359 Lines • ▼ Show 20 Lines | it('Can get all of the above txs, and a wild mega-tx, from the blockTxs endpoint after they are mined in a block', async () => { | ||||
confirmedTxsForAlpGenesisTxid.txs[i].tokenEntries, | confirmedTxsForAlpGenesisTxid.txs[i].tokenEntries, | ||||
).to.deep.equal(broadcastAlpTxsOfAlpGenesisTokenId[i].tokenEntries); | ).to.deep.equal(broadcastAlpTxsOfAlpGenesisTokenId[i].tokenEntries); | ||||
} | } | ||||
}); | }); | ||||
it('Can get confirmed and unconfirmed txs from tokenId.history()', async () => { | it('Can get confirmed and unconfirmed txs from tokenId.history()', async () => { | ||||
const chronikUrl = await chronik_url; | const chronikUrl = await chronik_url; | ||||
const chronik = new ChronikClientNode(chronikUrl); | const chronik = new ChronikClientNode(chronikUrl); | ||||
alpNonUtf8GenesisTxid = await get_alp_nonutf8_genesis_txid; | |||||
alpMintTwoTxid = await get_alp_mint_two_txid; | alpMintTwoTxid = await get_alp_mint_two_txid; | ||||
alpSendTwoTxid = await get_alp_send_two_txid; | |||||
// Can get the tx object from the tx endpoint | // Can get the tx object from the tx endpoint | ||||
alpMintTwo = await chronik.tx(alpMintTwoTxid); | alpMintTwo = await chronik.tx(alpMintTwoTxid); | ||||
alpSendTwo = await chronik.tx(alpSendTwoTxid); | alpSendTwo = await chronik.tx(alpNonUtf8GenesisTxid); | ||||
// We can get genesis info even if utf8 expected fields are not utf8 | |||||
// In practice we do not expect this to ever happen, but someone could do this | |||||
// We confirm it doesn't break anything | |||||
const thisTokenInfo = await chronik.token(alpNonUtf8GenesisTxid); | |||||
// hex 0304b60c048de8d9650881002834d6490000 | |||||
// A user of chronik-client would see output of '\x03\x04�\f\x04���e\b�\x00(4�I\x00\x00' for tokenInfo.genesisInfo.tokenName | |||||
expect(thisTokenInfo.genesisInfo?.tokenName).to.eql( | |||||
'\x03\x04\uFFFD\f\x04\uFFFD\uFFFD\uFFFDe\b\uFFFD\x00(4\uFFFDI\x00\x00', | |||||
); | |||||
// hex 00fabe6d6d6f5486f62c703086014607f5bed91d093b092a8faf5ac882a0ccf462682a22f002 | |||||
// A user of chronik-client would see output of '\x00��mmoT��,p0�\x01F\x07���\x1D\t;\t*��ZȂ���bh*"�\x02' for thisTokenInfo.genesisInfo.url | |||||
expect(thisTokenInfo.genesisInfo?.url).to.eql( | |||||
'\x00\uFFFD\uFFFDmmoT\uFFFD\uFFFD,p0\uFFFD\x01F\x07\uFFFD\uFFFD\uFFFD\x1D\t;\t*\uFFFD\uFFFDZȂ\uFFFD\uFFFD\uFFFDbh*"\uFFFD\x02', | |||||
); | |||||
// alpSendTwoTxid eb227bec6fd4d270262e14efa128a970f0ea4e529c599b1eb28af5fc8eaf3452 (broadcast 1st, alphabetically 2nd) | // alpNonUtf8GenesisTxid 65c63c950ec88a723cd37fc40f2e6f7732508a3703febed620b91d8b0c423eea (broadcast 1st, alphabetically 2nd) | ||||
// alpMintTwoTxid 665c70b6c01b8e9b4865136ee650bae344fb8b45def49eb7ec303b04d2520b4b (broadcast 2nd, alphabetically 1st) | // alpMintTwoTxid 163ebdbd2b915d090d602970b2e2737abf631a1ce31345c90d656e98b60e2b8c (broadcast 2nd, alphabetically 1st) | ||||
const alphabeticalUnconfirmedAlpGenesisTxs = [ | const alphabeticalUnconfirmedAlpGenesisTxs = [ | ||||
alpMintTwo, | alpMintTwo, | ||||
alpSendTwo, | alpSendTwo, | ||||
].sort((a, b) => a.txid.localeCompare(b.txid)); | ].sort((a, b) => a.txid.localeCompare(b.txid)); | ||||
// Can get these from unconfirmed txs | // Can get these from unconfirmed txs | ||||
const unconfirmedTxs = await chronik | const unconfirmedTxs = await chronik | ||||
.tokenId(alpGenesisTxid) | .tokenId(alpGenesisTxid) | ||||
▲ Show 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | it('We get tx history in expected order from both tokenId().history() and tokenId.confirmedTxs()', async () => { | ||||
// Confirmed txs are sorted by blockheight, then alphabetically by txid | // Confirmed txs are sorted by blockheight, then alphabetically by txid | ||||
// timeFirstSeen is not considered, demonstrated by alpMegaTxid not being first | // timeFirstSeen is not considered, demonstrated by alpMegaTxid not being first | ||||
const confirmedAlpTxids = [ | const confirmedAlpTxids = [ | ||||
alpMintTxid, // blockheight 102, timeFirstSeen 1300000000 | 0dab1008db30343a4f771983e9fd96cbc15f0c6efc73f5249c9bae311ef1e92f | alpMintTxid, // blockheight 102, timeFirstSeen 1300000000 | 0dab1008db30343a4f771983e9fd96cbc15f0c6efc73f5249c9bae311ef1e92f | ||||
alpMegaTxid, // blockheight 102, timeFirstSeen 0 | 72101f535470e0a6de7db9ba0ba115845566f738cc5124255b472347b5927565 | alpMegaTxid, // blockheight 102, timeFirstSeen 0 | 72101f535470e0a6de7db9ba0ba115845566f738cc5124255b472347b5927565 | ||||
alpGenesisTxid, // blockheight 102, timeFirstSeen 1300000000 | bb4d71aa6c0a92144f854402f2677975ad86d3a72cb7b0fb48d02473a88fc6e2 | alpGenesisTxid, // blockheight 102, timeFirstSeen 1300000000 | bb4d71aa6c0a92144f854402f2677975ad86d3a72cb7b0fb48d02473a88fc6e2 | ||||
alpMultiTxid, // blockheight 102, timeFirstSeen 1300000000 | e3c47f14d7ba3ab9a6f32a0fa8fcac41d06d3af595ebb5bab77ad03633a52eba | alpMultiTxid, // blockheight 102, timeFirstSeen 1300000000 | e3c47f14d7ba3ab9a6f32a0fa8fcac41d06d3af595ebb5bab77ad03633a52eba | ||||
alpSendTxid, //blockheight 102, timeFirstSeen 1300000000 | e623ab8971c93fa1a831a4310da65554c8dfd811c16cd5d41c6612268cb5dd5f | alpSendTxid, //blockheight 102, timeFirstSeen 1300000000 | e623ab8971c93fa1a831a4310da65554c8dfd811c16cd5d41c6612268cb5dd5f | ||||
alpMintTwoTxid, // blockheight 103, timeFirstSeen 1300000000 | 665c70b6c01b8e9b4865136ee650bae344fb8b45def49eb7ec303b04d2520b4b | alpMintTwoTxid, // blockheight 103, timeFirstSeen 1300000000 | 163ebdbd2b915d090d602970b2e2737abf631a1ce31345c90d656e98b60e2b8c | ||||
alpSendTwoTxid, // blockheight 103, timeFirstSeen 1300000000 | eb227bec6fd4d270262e14efa128a970f0ea4e529c599b1eb28af5fc8eaf3452 | alpNonUtf8GenesisTxid, // blockheight 103, timeFirstSeen 1300000000 | 65c63c950ec88a723cd37fc40f2e6f7732508a3703febed620b91d8b0c423eea | ||||
]; | ]; | ||||
// Same amount of txs in each | // Same amount of txs in each | ||||
expect(confirmedTxs.txs.length).to.eql(confirmedAlpTxids.length); | expect(confirmedTxs.txs.length).to.eql(confirmedAlpTxids.length); | ||||
// Txs are in expected order | // Txs are in expected order | ||||
for (let i = 0; i < confirmedTxs.txs.length; i += 1) { | for (let i = 0; i < confirmedTxs.txs.length; i += 1) { | ||||
expect(confirmedTxs.txs[i].txid).to.eql(confirmedAlpTxids[i]); | expect(confirmedTxs.txs[i].txid).to.eql(confirmedAlpTxids[i]); | ||||
} | } | ||||
// Can get all confirmed token txs for alpGenesisTxid | // Can get all confirmed token txs for alpGenesisTxid | ||||
const history = await chronik.tokenId(alpGenesisTxid).history(); | const history = await chronik.tokenId(alpGenesisTxid).history(); | ||||
// Txs from history are ordered by blockheight, then timeFirstSeen, then reverse alphabetical by txid | // Txs from history are ordered by blockheight, then timeFirstSeen, then reverse alphabetical by txid | ||||
// In this case, alpSendTwoTxid and alpMintTwoTxid are from the highest blockheight. | // In this case, alpSendTwoTxid and alpMintTwoTxid are from the highest blockheight. | ||||
// alpMegaTxid has timeFirstSeen of 0 because it had to be manually mined in block. So, it comes first in the next block | // alpMegaTxid has timeFirstSeen of 0 because it had to be manually mined in block. So, it comes first in the next block | ||||
// The other txids in the alpMegaTxid block all have the same timeFirstSeen, so they are sorted reverse alphabetically | // The other txids in the alpMegaTxid block all have the same timeFirstSeen, so they are sorted reverse alphabetically | ||||
const historyAlpTxids = [ | const historyAlpTxids = [ | ||||
alpSendTwoTxid, // timeFirstSeen 1300000000, blockheight 103 | eb227bec6fd4d270262e14efa128a970f0ea4e529c599b1eb28af5fc8eaf3452 | alpNonUtf8GenesisTxid, // timeFirstSeen 1300000000, blockheight 103 | 65c63c950ec88a723cd37fc40f2e6f7732508a3703febed620b91d8b0c423eea | ||||
alpMintTwoTxid, // timeFirstSeen 1300000000, blockheight 103 | 665c70b6c01b8e9b4865136ee650bae344fb8b45def49eb7ec303b04d2520b4b | alpMintTwoTxid, // timeFirstSeen 1300000000, blockheight 103 | 163ebdbd2b915d090d602970b2e2737abf631a1ce31345c90d656e98b60e2b8c | ||||
alpMegaTxid, // timeFirstSeen 0, blockheight 102 | 72101f535470e0a6de7db9ba0ba115845566f738cc5124255b472347b5927565 | alpMegaTxid, // timeFirstSeen 0, blockheight 102 | 72101f535470e0a6de7db9ba0ba115845566f738cc5124255b472347b5927565 | ||||
alpSendTxid, // timeFirstSeen 1300000000, blockheight 102 | e623ab8971c93fa1a831a4310da65554c8dfd811c16cd5d41c6612268cb5dd5f | alpSendTxid, // timeFirstSeen 1300000000, blockheight 102 | e623ab8971c93fa1a831a4310da65554c8dfd811c16cd5d41c6612268cb5dd5f | ||||
alpMultiTxid, // timeFirstSeen 1300000000, blockheight 102 | e3c47f14d7ba3ab9a6f32a0fa8fcac41d06d3af595ebb5bab77ad03633a52eba | alpMultiTxid, // timeFirstSeen 1300000000, blockheight 102 | e3c47f14d7ba3ab9a6f32a0fa8fcac41d06d3af595ebb5bab77ad03633a52eba | ||||
alpGenesisTxid, // timeFirstSeen 1300000000, blockheight 102 | bb4d71aa6c0a92144f854402f2677975ad86d3a72cb7b0fb48d02473a88fc6e2 | alpGenesisTxid, // timeFirstSeen 1300000000, blockheight 102 | bb4d71aa6c0a92144f854402f2677975ad86d3a72cb7b0fb48d02473a88fc6e2 | ||||
alpMintTxid, // timeFirstSeen 1300000000, blockheight 102 | 0dab1008db30343a4f771983e9fd96cbc15f0c6efc73f5249c9bae311ef1e92f | alpMintTxid, // timeFirstSeen 1300000000, blockheight 102 | 0dab1008db30343a4f771983e9fd96cbc15f0c6efc73f5249c9bae311ef1e92f | ||||
]; | ]; | ||||
// Same amount of txs in each | // Same amount of txs in each | ||||
expect(history.txs.length).to.eql(historyAlpTxids.length); | expect(history.txs.length).to.eql(historyAlpTxids.length); | ||||
// Txs in expected order | // Txs in expected order | ||||
for (let i = 0; i < confirmedTxs.txs.length; i += 1) { | for (let i = 0; i < confirmedTxs.txs.length; i += 1) { | ||||
expect(history.txs[i].txid).to.eql(historyAlpTxids[i]); | expect(history.txs[i].txid).to.eql(historyAlpTxids[i]); | ||||
} | } | ||||
}); | }); | ||||
}); | }); |