Changeset View
Standalone View
apps/ecash-herald/config.js
Show All 18 Lines | module.exports = { | ||||
fiatReference: { usd: '$', jpy: '¥', eur: '€', gbp: '£' }, | fiatReference: { usd: '$', jpy: '¥', eur: '€', gbp: '£' }, | ||||
ifpAddress: 'ecash:prfhcnyqnl5cgrnmlfmms675w93ld7mvvqd0y8lz07', | ifpAddress: 'ecash:prfhcnyqnl5cgrnmlfmms675w93ld7mvvqd0y8lz07', | ||||
tgMsgOptions: { | tgMsgOptions: { | ||||
parse_mode: 'HTML', | parse_mode: 'HTML', | ||||
disable_web_page_preview: true, | disable_web_page_preview: true, | ||||
}, | }, | ||||
knownMiners: [ | knownMiners: [ | ||||
{ | { | ||||
coinbaseScript: '566961425443', | coinbaseHexFragment: '566961425443', | ||||
miner: 'ViaBTC', | miner: 'ViaBTC', | ||||
payoutOutputScript: | |||||
'76a914f1c075a01882ae0972f95d3a4177c86c852b7d9188ac', | |||||
testBlocks: [ | |||||
{ | |||||
height: 791160, | |||||
coinbaseHex: | |||||
'0378120c182f5669614254432f4d696e6564206279203236303738362f103b6fa20ff3648a69acc31ed9b4946c00', | |||||
parsed: 'ViaBTC, Mined by 260786', | |||||
}, | |||||
{ | |||||
height: 791162, | |||||
coinbaseHex: | |||||
'037a120c1b2f5669614254432f4d696e656420627920616e6d6f6c393934362f10506fba0b63c1be4232055d9432860000', | |||||
parsed: 'ViaBTC, Mined by anmol9946', | |||||
}, | |||||
{ | |||||
height: 791152, | |||||
coinbaseHex: | |||||
'0370120c192f5669614254432f4d696e6564206279207374616c6365722f10eb6ea10f92ef957d84c8bb6769e22d00', | |||||
parsed: 'ViaBTC, Mined by stalcer', | |||||
}, | |||||
], | |||||
Fabien: The test vectors have nothing to do in config.js | |||||
bytesofmanAuthorUnsubmitted Done Inline ActionsThis isn't the only thing currently living in config.js that isn't really a config and should require a diff to change. Could move this and also the opReturn constants into their own files. imo that's beyond the scope of this diff. I've added a task to improve this organization T3162 I'd like to keep the test vectors in the same place as the miners, so it's clear that adding another miner requires adding associated test blocks in this format. bytesofman: This isn't the only thing currently living in `config.js` that isn't really a config and should… | |||||
FabienUnsubmitted Not Done Inline Actions
Agreed, and that should be done first so that this diff can be rebased on top.
That rational makes zero sense. The whole point of unit tests is to make sure the function does what it claims. The unit tests are not supposed to run on every single possible case ! You're testing some happy paths and the edges cases, then the function does always the same job so unless there is a new feature, you don't need more test. You're not testing block parsing on the whole blockchain, and update the test vectors for every new block right ? Fabien: > This isn't the only thing currently living in config.js that isn't really a config and should… | |||||
bytesofmanAuthorUnsubmitted Done Inline ActionsAdding another miner could require changes to the getMinerFromCoinbaseTx function. Need a unit test to prove getMinerFromCoinbaseTx works with an added miner. We may or may not have a block in blocks.js for this new miner; for example I don't think it's worth adding a new block to blocks.js just to cover the lone zpool block we have seen so far. But we do need a unit test to prove that getMinerFromCoinbaseTx correctly recognizes zpool miner. Will shelf this diff while I work on some of the pre-reqs. What kind of organization would you like to see here? bytesofman: Adding another miner could require changes to the `getMinerFromCoinbaseTx` function.
Need a… | |||||
}, | }, | ||||
{ | { | ||||
coinbaseScript: '4d696e696e672d4475746368', | coinbaseHexFragment: '4d696e696e672d4475746368', | ||||
miner: 'Mining-Dutch', | miner: 'Mining-Dutch', | ||||
payoutOutputScript: | |||||
'76a914a24e2b67689c3753983d3b408bc7690d31b1b74d88ac', | |||||
testBlocks: [ | |||||
{ | |||||
height: 791169, | |||||
coinbaseHex: | |||||
'0381120c04498b5a6408fabe6d6d2824fdd18ac6fdbf7196476428cc714e3841f1ff289127197ca59466b3ae739a0001000000000000000000115bba02001401112f4d696e696e672d44757463682f2d3231', | |||||
parsed: 'Mining-Dutch', | |||||
}, | |||||
{ | |||||
height: 791165, | |||||
coinbaseHex: | |||||
'037d120c04b7895a6408fabe6d6d3552401c3f02d70ca60a4bd927ab08f4bd7412821435244a72d4002d5baf3e52000100000000000000003b4dbeab12001b01112f4d696e696e672d44757463682f2d3231', | |||||
parsed: 'Mining-Dutch', | |||||
}, | |||||
{ | |||||
height: 790644, | |||||
coinbaseHex: | |||||
'0374100c0402c4546408fabe6d6dd9cb39f3ab01d745d7cf94bb2da744d5238ce6d91f2b495d697719dacbde4122000100000000000000a3b914314cf2000c01112f4d696e696e672d44757463682f2d3234', | |||||
parsed: 'Mining-Dutch', | |||||
}, | |||||
], | |||||
}, | |||||
{ | |||||
// While Hathor-MM block coinbase scripts do contain "mm", | |||||
// this is judged insufficient to uniquely identify | |||||
coinbaseHexFragment: null, | |||||
miner: 'Hathor-MM', | |||||
payoutOutputScript: | |||||
'76a914ce8c8cf69a922a607e8e03e27ec014fbc24882e088ac', | |||||
testBlocks: [ | |||||
{ | |||||
height: 791154, | |||||
coinbaseHex: | |||||
'0372120c04ca6f5a640cfabe6d6d0000000000000000000000000000000000000000000000000000000000000000010000000000000017ffe3db2f2981010000000015663561663031393839363731656539633239383034', | |||||
parsed: 'Hathor-MM', | |||||
}, | |||||
{ | |||||
height: 790242, | |||||
coinbaseHex: | |||||
'03e20e0c04cdc250640cfabe6d6d00000000000000000000000000000000000000000000000000000000000000000100000000000000780131c9f83700000000000015303637373062323039393135643332643630303333', | |||||
parsed: 'Hathor-MM', | |||||
}, | |||||
{ | |||||
height: 790837, | |||||
coinbaseHex: | |||||
'0335110c0408fa56640cfabe6d6d000000000000000000000000000000000000000000000000000000000000000001000000000000005ffff258d57091000000000015653364396135343132373039306165353131333437', | |||||
parsed: 'Hathor-MM', | |||||
}, | |||||
], | |||||
}, | |||||
{ | |||||
coinbaseHexFragment: '5a554c55506f6f4c', | |||||
miner: 'Zulu Pool', | |||||
payoutOutputScript: | |||||
'76a9141b1bbcb888b4440a573427f526cb221f657318cf88ac', | |||||
testBlocks: [ | |||||
{ | |||||
height: 785677, | |||||
coinbaseHex: | |||||
'030dfd0b48617468a881a54b5fbc28b27eb3ed59fc4924a3b991033fee7a78b919170a92d9b7beaf5a554c55506f6f4c2d584543000011d8e9bb1b00', | |||||
parsed: 'Zulu Pool', | |||||
}, | |||||
{ | |||||
height: 790413, | |||||
coinbaseHex: | |||||
'038d0f0c48617468606e02e2feb6112decb0dbe728053841e8e16bcd643fc0cb4389e7e1a318bb735a554c55506f6f4c2d58454300002714214b0598', | |||||
parsed: 'Zulu Pool', | |||||
}, | |||||
{ | |||||
height: 789691, | |||||
coinbaseHex: | |||||
'03bb0c0c48617468bb1017e3800bb814cc6912cdaa37488fd50a70da9e19b09a7e271bde7417d42d5a554c55506f6f4c2d5845430000171fcc948505', | |||||
parsed: 'Zulu Pool', | |||||
}, | |||||
], | |||||
}, | |||||
{ | |||||
coinbaseHexFragment: '636b706f6f6c', | |||||
miner: 'CK Pool', | |||||
payoutOutputScript: | |||||
'76a914c857e19f313157ead29b6fa0fa9c772a9ec6c06888ac', | |||||
testBlocks: [ | |||||
{ | |||||
// ck pool but different address from IceBerg | |||||
height: 788631, | |||||
parsed: 'CK Pool', | |||||
coinbaseHex: | |||||
'0397080c04181678a1046498416404bb67ca0d0c3692416477630100000000000a636b706f6f6c', | |||||
}, | |||||
{ | |||||
height: 791069, | |||||
parsed: 'IceBerg', | |||||
coinbaseHex: | |||||
'031d120c041821710c04556e5964043c958a2e0c4a794764d2ea1400000000000a636b706f6f6c122f6d696e656420627920496365426572672f', | |||||
}, | |||||
{ | |||||
height: 788164, | |||||
parsed: 'IceBerg', | |||||
coinbaseHex: | |||||
'03c4060c04181750ed0429773d6404180b99200c20493a6402911a00000000000a636b706f6f6c122f6d696e656420627920496365426572672f', | |||||
}, | |||||
], | |||||
}, | |||||
{ | |||||
// Note, the lone zpool block also contains 'mm', could be Hathor related | |||||
coinbaseHexFragment: '7a706f6f6c2e6361', | |||||
miner: 'zpool', | |||||
payoutOutputScript: | |||||
'76a91497b4ae75a3bfab8bf10ef17e133efe34a4a13df788ac', | |||||
testBlocks: [ | |||||
{ | |||||
height: 790863, | |||||
coinbaseHex: | |||||
'034f110c04602a5764084200079077422b017a706f6f6c2e636100fabe6d6da821294426652ebd8cff8df5e02ffcbbdc1b1d9e9022832acf4d071e9bfa2d952000000000000000', | |||||
parsed: 'zpool', | |||||
}, | |||||
], | |||||
}, | }, | ||||
], | ], | ||||
opReturn: { | opReturn: { | ||||
opReturnPrefix: '6a', | opReturnPrefix: '6a', | ||||
opReturnAppPrefixLength: '04', | opReturnAppPrefixLength: '04', | ||||
opPushDataOne: '4c', | opPushDataOne: '4c', | ||||
appPrefixes: { | appPrefixes: { | ||||
'00746162': 'Cashtab Msg', | '00746162': 'Cashtab Msg', | ||||
Show All 34 Lines |
The test vectors have nothing to do in config.js