代码拉取完成,页面将自动刷新
npm install
##compiling your contracts
npx hardhat compile
ywd@ubuntu:~/workspace/vue3/htlc$ npx hardhat run scripts/deploy.js
Lock deployed to 0x5FbDB2315678afecb367f032d93F642f64180aa3
ywd@ubuntu:~/workspace/vue3/htlc$ npx hardhat test
HTLC
Deployment
✔ Should set the right unlockTime (1397ms)
HashedTimeLock
newHTLC() test
✔ Should create newHTLC (130ms)
✔ Should return error when create newHTLC with incorrect args (57ms)
✔ Should return error when create newHTLC with timelocks in the past (39ms)
✔ Should return error when create newHTLC with same preimage (104ms)
withdraw() test
✔ Should success to extract the locked asset (121ms)
✔ Should return error when hashlock hash does not match (63ms)
✔ Should return error when already withdrawn (88ms)
✔ Should return error when timeout (3054ms)
refund() test
✔ Should sender calls this method to retrieve the locked asset (3085ms)
✔ Should return error when already refunded (3087ms)
✔ Should return error when already withdrawn (5088ms)
✔ Should return error when timelock not yet passed (2052ms)
13 passing (18s)
# a blockchain
npx hardhat node --port 8545
# b blockchain
npx hardhat node --port 9545
connet two blockchain
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。