Erdpy运行Mandos测试报错setState的SC地址正确格式是什么?
你遇到的报错是因为当前版本的Mandos测试框架对地址标识格式有区分要求:普通用户地址使用address:前缀,智能合约(SC)地址必须使用sc:前缀标识,原教程中的旧示例写法不适用于你当前使用的工具版本。
setState中SC地址的正确格式
newAddresses字段下的智能合约地址需要以sc:为前缀,你配置中的对应值应修改为sc:the_crowdfunding_contract,同时需要同步修改测试配置中所有引用该合约地址的位置。
修改后的完整测试配置如下:
{ "name": "tutorial_crowdfunding", "steps": [ { "step": "setState", "accounts": { "address:my_address": { "nonce": "0", "balance": "1,000,000" } }, "newAddresses": [ { "creatorAddress": "address:my_address", "creatorNonce": "0", "newAddress": "sc:the_crowdfunding_contract" } ] }, { "step": "scDeploy", "tx": { "from": "address:my_address", "contractCode": "file:../output/tutorial_crowdfunding.wasm", "value": "0", "gasLimit": "1,000,000", "gasPrice": "0" }, "expect": { "status": "0", "gas": "*", "refund": "*" } }, { "step": "checkState", "accounts": { "address:my_address": { "nonce": "1", "balance": "1,000,000" }, "sc:the_crowdfunding_contract": { "nonce": "0", "balance": "0", "storage": { "''owner": "address:my_address" }, "code": "file:../output/tutorial_crowdfunding.wasm" } } } ] }
修改完成后重新执行erdpy contract test命令即可正常运行测试。
内容的提问来源于stack exchange,提问作者mccuna
相关产品推荐
相关产品推荐

