diff --git a/apps/ecash-herald/scripts/generateMock.js b/apps/ecash-herald/scripts/generateMock.js --- a/apps/ecash-herald/scripts/generateMock.js +++ b/apps/ecash-herald/scripts/generateMock.js @@ -7,7 +7,7 @@ const path = require('path'); const { ChronikClient } = require('chronik-client'); const chronik = new ChronikClient(config.chronik); -const { MockChronikClient } = require('../../mock-chronik-client'); +const { MockChronikClient } = require('../../../modules/mock-chronik-client'); const mockedChronik = new MockChronikClient(); const { jsonReplacer, getCoingeckoApiUrl } = require('../src/utils'); const unrevivedBlockMocks = require('../test/mocks/block'); diff --git a/apps/ecash-herald/src/parse.js b/apps/ecash-herald/src/parse.js --- a/apps/ecash-herald/src/parse.js +++ b/apps/ecash-herald/src/parse.js @@ -1680,6 +1680,21 @@ } | ${miner}`, ); + // Halving countdown + const HALVING_HEIGHT = 840000; + const blocksLeft = HALVING_HEIGHT - height; + if (blocksLeft > 0) { + // countdown + tgMsg.push( + `โฐ ${blocksLeft.toLocaleString()} block${ + blocksLeft !== 1 ? 's' : '' + } until eCash halving`, + ); + } + if (height === HALVING_HEIGHT) { + tgMsg.push(`๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰ eCash block reward reduced by 50% ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰`); + } + // Staker // Staking rewards to if (staker) { diff --git a/apps/ecash-herald/test/mocks/block.js b/apps/ecash-herald/test/mocks/block.js --- a/apps/ecash-herald/test/mocks/block.js +++ b/apps/ecash-herald/test/mocks/block.js @@ -4587,10 +4587,10 @@ ], }, blockSummaryTgMsgs: [ - '๐Ÿ“ฆ819346 | 20 txs | anon e0\n๐Ÿ’ฐ$63 to qrp...cwt | ๐Ÿš€\n1 XEC = $0.0001\n1 BTC = $30,000\n1 ETH = $2,000\n\n1 new eToken created\n๐ŸงชLOLLY (Lolly) [doc]\n\n4 eToken send txs\n๐ŸŽŸ 55 DVV\n๐ŸŽŸ 10.9876543 WDT\n๐ŸŽŸ 5,000,000.00 GRP\n๐ŸŽŸ 356.6918 BUX\n\n1 eToken burn tx\n๐Ÿ”ฅqp9...et0 burned 1.00 GRP \n\n11 app txs\nโš›๏ธCashFusion: Fused $1k from 64 inputs into 63 outputs\nโ“unknown: 0x663ddd99990bcd9699...\nโ“unknown: =:ETH.ETH:0xa9aaF30F65955C69c16B3345B51D426D9B88Ba87:841321:tr:0\n๐Ÿช‚Airdrop: qru...jys airdropped $5 to 13 holders of STUB|Stay with us, eCash Africa is the next big community in the African cryptosphere. \n๐Ÿ–‹Cashtab Msg, $1 for $0.0005: I like eCash\nโ“EMPP: ALP:SEND|CRD|1.9673\n๐Ÿ”Cashtab Encrypted: qq9...fgx sent an encrypted message and $0.002 to qzv...fed\n๐Ÿ‘พAlias (beta): doge2\nโ“EMPP: ALP:MINT|CRD|0.0\n๐ŸคณSWaP: Signal|SLP Atomic Swap|STUB|SELL for 159,883.54 XEC|Min trade: 0 XEC', + '๐Ÿ“ฆ819346 | 20 txs | anon e0\nโฐ 20,654 blocks until eCash halving\n๐Ÿ’ฐ$63 to qrp...cwt | ๐Ÿš€\n1 XEC = $0.0001\n1 BTC = $30,000\n1 ETH = $2,000\n\n1 new eToken created\n๐ŸงชLOLLY (Lolly) [doc]\n\n4 eToken send txs\n๐ŸŽŸ 55 DVV\n๐ŸŽŸ 10.9876543 WDT\n๐ŸŽŸ 5,000,000.00 GRP\n๐ŸŽŸ 356.6918 BUX\n\n1 eToken burn tx\n๐Ÿ”ฅqp9...et0 burned 1.00 GRP \n\n11 app txs\nโš›๏ธCashFusion: Fused $1k from 64 inputs into 63 outputs\nโ“unknown: 0x663ddd99990bcd9699...\nโ“unknown: =:ETH.ETH:0xa9aaF30F65955C69c16B3345B51D426D9B88Ba87:841321:tr:0\n๐Ÿช‚Airdrop: qru...jys airdropped $5 to 13 holders of STUB|Stay with us, eCash Africa is the next big community in the African cryptosphere. \n๐Ÿ–‹Cashtab Msg, $1 for $0.0005: I like eCash\nโ“EMPP: ALP:SEND|CRD|1.9673\n๐Ÿ”Cashtab Encrypted: qq9...fgx sent an encrypted message and $0.002 to qzv...fed\n๐Ÿ‘พAlias (beta): doge2\nโ“EMPP: ALP:MINT|CRD|0.0\n๐ŸคณSWaP: Signal|SLP Atomic Swap|STUB|SELL for 159,883.54 XEC|Min trade: 0 XEC', '๐Ÿ—žmemo: Reply to memo|memo|Twitter keeps turning their API on and off. Sometimes it works, sometimes it doesn\'t. Feature to create tweets from memo may work again at some point.\n\n2 eCash txs\n๐Ÿ’ธ$584k for $0.0003 ๐Ÿณ Binance โžก๏ธ itself\n๐Ÿ’ธ$107k for $0.003 qp7...sr4 โžก๏ธ ๐Ÿฆ€qzj...ksg', ], blockSummaryTgMsgsApiFailure: [ - '๐Ÿ“ฆ819346 | 20 txs | anon e0\n๐Ÿ’ฐ625k XEC to qrp...cwt\n\n1 new eToken created\n๐ŸงชLOLLY (Lolly) [doc]\n\n11 app txs\nโš›๏ธCashFusion: Fused 13M XEC from 64 inputs into 63 outputs\nโ“unknown: 0x663ddd99990bcd9699...\nโ“unknown: =:ETH.ETH:0xa9aaF30F65955C69c16B3345B51D426D9B88Ba87:841321:tr:0\n๐Ÿช‚Airdrop: qru...jys airdropped 45k XEC to 13 holders of b76...84a|Stay with us, eCash Africa is the next big community in the African cryptosphere. \n๐Ÿ–‹Cashtab Msg, 10k XEC for 4.79 XEC: I like eCash\nโ“EMPP: ALP:SEND|CRD|1.9673\n๐Ÿ”Cashtab Encrypted: qq9...fgx sent an encrypted message and 20 XEC to qzv...fed\n๐Ÿ‘พAlias (beta): doge2\nโ“EMPP: ALP:MINT|CRD|0.0\n๐ŸคณSWaP: Signal|SLP Atomic Swap|Unknown Token|SELL for 159,883.54 XEC|Min trade: 0 XEC\n๐Ÿ—žmemo: Reply to memo|memo|Twitter keeps turning their API on and off. Sometimes it works, sometimes it doesn\'t. Feature to create tweets from memo may work again at some point.\n\n7 eCash txs\n๐Ÿ’ธ6B XEC for 2.6 XEC\n๐Ÿ’ธ1B XEC for 29 XEC\n๐Ÿ’ธ5.46 XEC for 11 XEC\n๐Ÿ’ธ5.46 XEC for 11 XEC\n๐Ÿ’ธ5.46 XEC for 11 XEC\n๐Ÿ’ธ0 XEC for 16 XEC\n๐Ÿ’ธ0 XEC for 11 XEC', + '๐Ÿ“ฆ819346 | 20 txs | anon e0\nโฐ 20,654 blocks until eCash halving\n๐Ÿ’ฐ625k XEC to qrp...cwt\n\n1 new eToken created\n๐ŸงชLOLLY (Lolly) [doc]\n\n11 app txs\nโš›๏ธCashFusion: Fused 13M XEC from 64 inputs into 63 outputs\nโ“unknown: 0x663ddd99990bcd9699...\nโ“unknown: =:ETH.ETH:0xa9aaF30F65955C69c16B3345B51D426D9B88Ba87:841321:tr:0\n๐Ÿช‚Airdrop: qru...jys airdropped 45k XEC to 13 holders of b76...84a|Stay with us, eCash Africa is the next big community in the African cryptosphere. \n๐Ÿ–‹Cashtab Msg, 10k XEC for 4.79 XEC: I like eCash\nโ“EMPP: ALP:SEND|CRD|1.9673\n๐Ÿ”Cashtab Encrypted: qq9...fgx sent an encrypted message and 20 XEC to qzv...fed\n๐Ÿ‘พAlias (beta): doge2\nโ“EMPP: ALP:MINT|CRD|0.0\n๐ŸคณSWaP: Signal|SLP Atomic Swap|Unknown Token|SELL for 159,883.54 XEC|Min trade: 0 XEC\n๐Ÿ—žmemo: Reply to memo|memo|Twitter keeps turning their API on and off. Sometimes it works, sometimes it doesn\'t. Feature to create tweets from memo may work again at some point.\n\n7 eCash txs\n๐Ÿ’ธ6B XEC for 2.6 XEC\n๐Ÿ’ธ1B XEC for 29 XEC\n๐Ÿ’ธ5.46 XEC for 11 XEC\n๐Ÿ’ธ5.46 XEC for 11 XEC\n๐Ÿ’ธ5.46 XEC for 11 XEC\n๐Ÿ’ธ0 XEC for 16 XEC\n๐Ÿ’ธ0 XEC for 11 XEC', ], };