it('should return a received transaction between yesterday and tomorrow',()=>s1.expect('/tx/history/DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo/times/'+yesterday+'/'+tomorrow,(res:any)=>{
it('should not return a received transaction the day after tomorrow',()=>s1.expect('/tx/history/DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo/times/'+tomorrow+'/'+intwodays,(res:any)=>{
awaitshouldFail(toc.sendTX(tx2),'Wrong unlocker in transaction');
awaitshouldFail(toc.sendTX(tx3),'Wrong unlocker in transaction');
awaitshouldNotFail(toc.sendTX(tx4));
awaitshouldFail(toc.sendTX(tx5),'Wrong unlocker in transaction');
awaitshouldFail(toc.sendTX(tx6),'Wrong unlocker in transaction');
awaits1.commit({time:now+19840});// TX4 commited
(awaits1.get('/tx/sources/DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo')).should.have.property('sources').length(0);// The tx was not sent to someone, but with an XHX! So toc has nothing more than before.
lettx8=awaittic.prepareUTX(tx4,['XHX(1872767826647264)'],[{qty:1200,base:0,lock:'SIG('+toc.pub+')'}],{comment:'okk',blockstamp:[current.number,current.hash].join('-')});// tic unlocks the XHX locked amount, and gives it to toc!
awaitshouldFail(toc.sendTX(tx7),'Wrong unlocker in transaction');
awaitshouldNotFail(toc.sendTX(tx8));
awaits1.commit({time:now+19840});// TX8 commited
(awaits1.get('/tx/sources/DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo')).should.have.property('sources').length(1);// That's why toc now has 1 more source...
(awaits1.get('/tx/sources/DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV')).should.have.property('sources').length(3);// ...and why tic's number of sources hasn't changed
(awaits1.get('/tx/sources/DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo')).should.have.property('sources').length(1);// toc is also present in the target of tx2
(awaits1.get('/tx/sources/DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV')).should.have.property('sources').length(4);// As well as tic