[英]How to test a Solidity payable contract
I am currently testings an application created using solidity with foundry, and I am wondering how to mock a "payable" function in the tests by a method paying ether to the blockchain.我目前正在测试一个使用铸造厂使用solidity创建的应用程序,我想知道如何通过向区块链支付以太币的方法在测试中模拟“可支付” function。 Does anyone know of any built-in functions that would do this?有谁知道可以做到这一点的任何内置函数? Thanks in advance.提前致谢。
you can use HARDHAT for integrated testing with local devchain.您可以使用 HARDHAT 与本地开发链进行集成测试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.