Build & test BCH smart contracts with mock networks in CashScript
Watch on YouTube (opens in a new tab)- Speaker
- GeukensMathieu
- Space
- Published
- Length
Transcript
What you can do is you initialize a mock network provider. So then you have a mock network environment, and you create UTXOs to specific addresses you want to test, and then you can start writing transactions. And this transaction takes into account all the local context, so which UTXO exist, but then also things like the lock time, the block height you set in this mock network environment. And if it fails because of CashScript, you will get a two-way mapping. So you will get a nice error that's thrown at which line your contract fails, which input this is failing, because of course you can have many contracts and your inputs in a UTXO transaction. So it will say, for example, input one failed at line 11 in CashScript, and then it will give you the provided string. So CashScript has the option to give a human readable error message for each require message.



