Changeset View
Changeset View
Standalone View
Standalone View
apps/ecash-herald/test/parse.test.ts
| Show First 20 Lines • Show All 453 Lines • ▼ Show 20 Lines | it('summarizeTxHistory summarizes a collection of txs across multiple blocks including fiat prices', function () { | ||||
| usd_market_cap: 689047177.8128564, | usd_market_cap: 689047177.8128564, | ||||
| usd_24h_vol: 5957332.9687223025, | usd_24h_vol: 5957332.9687223025, | ||||
| usd_24h_change: -0.3973642442197056, | usd_24h_change: -0.3973642442197056, | ||||
| }, | }, | ||||
| block.activeStakers, | block.activeStakers, | ||||
| ), | ), | ||||
| [ | [ | ||||
| '<b>14 Oct 2024</b>\n' + | '<b>14 Oct 2024</b>\n' + | ||||
| '📦61,585 blocks\n' + | '📦90,011 blocks\n' + | ||||
| '➡️37 txs\n' + | '➡️38 txs\n' + | ||||
| `💧<i>0.00% capacity</i>\n` + | `💧<i>0.00% capacity</i>\n` + | ||||
| '\n' + | '\n' + | ||||
| '📉<b>1 XEC = $0.00003487</b> <i>(-0.40%)</i>\n' + | '📉<b>1 XEC = $0.00003487</b> <i>(-0.40%)</i>\n' + | ||||
| 'Trading volume: $5,957,333\n' + | 'Trading volume: $5,957,333\n' + | ||||
| 'Market cap: $689,047,178\n' + | 'Market cap: $689,047,178\n' + | ||||
| '\n' + | '\n' + | ||||
| '<b><i>⛏️3 miners found blocks</i></b>\n' + | '<b><i>⛏️3 miners found blocks</i></b>\n' + | ||||
| '<u>Top 3</u>\n' + | '<u>Top 3</u>\n' + | ||||
| ▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | it('summarizeTxHistory summarizes a collection of txs across multiple blocks including fiat prices', function () { | ||||
| '🛒 <b>1</b> PayButton tx\n' + | '🛒 <b>1</b> PayButton tx\n' + | ||||
| '🪂 <b>1</b> Airdrop\n' + | '🪂 <b>1</b> Airdrop\n' + | ||||
| '✏️ <b>1</b> Cashtab Msg\n' + | '✏️ <b>1</b> Cashtab Msg\n' + | ||||
| '💬 <b>1</b> <a href="https://www.ecashchat.com/">eCashChat tx</a>\n' + | '💬 <b>1</b> <a href="https://www.ecashchat.com/">eCashChat tx</a>\n' + | ||||
| '🔓 <b>1</b> eCashChat Auth\n' + | '🔓 <b>1</b> eCashChat Auth\n' + | ||||
| '💸 <b>1</b> Paywall tx\n' + | '💸 <b>1</b> Paywall tx\n' + | ||||
| '\n' + | '\n' + | ||||
| '🏦 <b><i>Binance</i></b>\n' + | '🏦 <b><i>Binance</i></b>\n' + | ||||
| '<b>1</b> withdrawal, $0.688', | '<b>1</b> withdrawal, $0.688\n' + | ||||
| '🏦 <b><i>CoinEx</i></b>\n' + | |||||
| '<b>1</b> withdrawal, $15.91k', | |||||
| ], | ], | ||||
| ); | ); | ||||
| }); | }); | ||||
| it('summarizeTxHistory summarizes a collection of txs across multiple blocks including fiat prices with no token cache info', function () { | it('summarizeTxHistory summarizes a collection of txs across multiple blocks including fiat prices with no token cache info', function () { | ||||
| const mockUtcNewDayTimestampSeconds = 1728950400; | const mockUtcNewDayTimestampSeconds = 1728950400; | ||||
| assert.deepEqual( | assert.deepEqual( | ||||
| summarizeTxHistory( | summarizeTxHistory( | ||||
| mockUtcNewDayTimestampSeconds, | mockUtcNewDayTimestampSeconds, | ||||
| dailyTxs, | dailyTxs, | ||||
| // we can't get any token cache info | // we can't get any token cache info | ||||
| new Map(), | new Map(), | ||||
| 10, // show all tested agora tokens | 10, // show all tested agora tokens | ||||
| 10, // show all tested non-agora tokens | 10, // show all tested non-agora tokens | ||||
| { | { | ||||
| usd: 0.00003487, | usd: 0.00003487, | ||||
| usd_market_cap: 689047177.8128564, | usd_market_cap: 689047177.8128564, | ||||
| usd_24h_vol: 5957332.9687223025, | usd_24h_vol: 5957332.9687223025, | ||||
| usd_24h_change: -0.3973642442197056, | usd_24h_change: -0.3973642442197056, | ||||
| }, | }, | ||||
| block.activeStakers, | block.activeStakers, | ||||
| ), | ), | ||||
| [ | [ | ||||
| '<b>14 Oct 2024</b>\n' + | '<b>14 Oct 2024</b>\n' + | ||||
| '📦61,585 blocks\n' + | '📦90,011 blocks\n' + | ||||
| '➡️37 txs\n' + | '➡️38 txs\n' + | ||||
| `💧<i>0.00% capacity</i>\n` + | `💧<i>0.00% capacity</i>\n` + | ||||
| '\n' + | '\n' + | ||||
| '📉<b>1 XEC = $0.00003487</b> <i>(-0.40%)</i>\n' + | '📉<b>1 XEC = $0.00003487</b> <i>(-0.40%)</i>\n' + | ||||
| 'Trading volume: $5,957,333\n' + | 'Trading volume: $5,957,333\n' + | ||||
| 'Market cap: $689,047,178\n' + | 'Market cap: $689,047,178\n' + | ||||
| '\n' + | '\n' + | ||||
| '<b><i>⛏️3 miners found blocks</i></b>\n' + | '<b><i>⛏️3 miners found blocks</i></b>\n' + | ||||
| '<u>Top 3</u>\n' + | '<u>Top 3</u>\n' + | ||||
| ▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | it('summarizeTxHistory summarizes a collection of txs across multiple blocks including fiat prices with no token cache info', function () { | ||||
| '🛒 <b>1</b> PayButton tx\n' + | '🛒 <b>1</b> PayButton tx\n' + | ||||
| '🪂 <b>1</b> Airdrop\n' + | '🪂 <b>1</b> Airdrop\n' + | ||||
| '✏️ <b>1</b> Cashtab Msg\n' + | '✏️ <b>1</b> Cashtab Msg\n' + | ||||
| '💬 <b>1</b> <a href="https://www.ecashchat.com/">eCashChat tx</a>\n' + | '💬 <b>1</b> <a href="https://www.ecashchat.com/">eCashChat tx</a>\n' + | ||||
| '🔓 <b>1</b> eCashChat Auth\n' + | '🔓 <b>1</b> eCashChat Auth\n' + | ||||
| '💸 <b>1</b> Paywall tx\n' + | '💸 <b>1</b> Paywall tx\n' + | ||||
| '\n' + | '\n' + | ||||
| '🏦 <b><i>Binance</i></b>\n' + | '🏦 <b><i>Binance</i></b>\n' + | ||||
| '<b>1</b> withdrawal, $0.688', | '<b>1</b> withdrawal, $0.688\n' + | ||||
| '🏦 <b><i>CoinEx</i></b>\n' + | |||||
| '<b>1</b> withdrawal, $15.91k', | |||||
| ], | ], | ||||
| ); | ); | ||||
| }); | }); | ||||
| it('summarizeTxHistory summarizes a collection of txs across multiple blocks without fiat price or staker info', function () { | it('summarizeTxHistory summarizes a collection of txs across multiple blocks without fiat price or staker info', function () { | ||||
| const mockUtcNewDayTimestampSeconds = 1728950400; | const mockUtcNewDayTimestampSeconds = 1728950400; | ||||
| assert.deepEqual( | assert.deepEqual( | ||||
| summarizeTxHistory( | summarizeTxHistory( | ||||
| mockUtcNewDayTimestampSeconds, | mockUtcNewDayTimestampSeconds, | ||||
| dailyTxs, | dailyTxs, | ||||
| tokenInfoMap, | tokenInfoMap, | ||||
| 10, // show all tested agora tokens | 10, // show all tested agora tokens | ||||
| 10, // show all tested non-agora tokens | 10, // show all tested non-agora tokens | ||||
| ), | ), | ||||
| [ | [ | ||||
| '<b>14 Oct 2024</b>\n' + | '<b>14 Oct 2024</b>\n' + | ||||
| '📦61,585 blocks\n' + | '📦90,011 blocks\n' + | ||||
| '➡️37 txs\n' + | '➡️38 txs\n' + | ||||
| `💧<i>0.00% capacity</i>\n` + | `💧<i>0.00% capacity</i>\n` + | ||||
| '\n' + | '\n' + | ||||
| '<b><i>⛏️3 miners found blocks</i></b>\n' + | '<b><i>⛏️3 miners found blocks</i></b>\n' + | ||||
| '<u>Top 3</u>\n' + | '<u>Top 3</u>\n' + | ||||
| '1. Mining-Dutch, 1 <i>(0%)</i>\n' + | '1. Mining-Dutch, 1 <i>(0%)</i>\n' + | ||||
| '2. solopool.org, 1 <i>(0%)</i>\n' + | '2. solopool.org, 1 <i>(0%)</i>\n' + | ||||
| '3. ViaBTC, 1 <i>(0%)</i>\n' + | '3. ViaBTC, 1 <i>(0%)</i>\n' + | ||||
| '\n' + | '\n' + | ||||
| Show All 39 Lines | it('summarizeTxHistory summarizes a collection of txs across multiple blocks without fiat price or staker info', function () { | ||||
| '🛒 <b>1</b> PayButton tx\n' + | '🛒 <b>1</b> PayButton tx\n' + | ||||
| '🪂 <b>1</b> Airdrop\n' + | '🪂 <b>1</b> Airdrop\n' + | ||||
| '✏️ <b>1</b> Cashtab Msg\n' + | '✏️ <b>1</b> Cashtab Msg\n' + | ||||
| '💬 <b>1</b> <a href="https://www.ecashchat.com/">eCashChat tx</a>\n' + | '💬 <b>1</b> <a href="https://www.ecashchat.com/">eCashChat tx</a>\n' + | ||||
| '🔓 <b>1</b> eCashChat Auth\n' + | '🔓 <b>1</b> eCashChat Auth\n' + | ||||
| '💸 <b>1</b> Paywall tx\n' + | '💸 <b>1</b> Paywall tx\n' + | ||||
| '\n' + | '\n' + | ||||
| '🏦 <b><i>Binance</i></b>\n' + | '🏦 <b><i>Binance</i></b>\n' + | ||||
| '<b>1</b> withdrawal, 20k XEC', | '<b>1</b> withdrawal, 20k XEC\n' + | ||||
| '🏦 <b><i>CoinEx</i></b>\n' + | |||||
| '<b>1</b> withdrawal, 456M XEC', | |||||
| ], | ], | ||||
| ); | ); | ||||
| }); | }); | ||||
| }); | }); | ||||