【问题标题】:I'm having problems writing test for my Solidity contract?我在为我的 Solidity 合约编写测试时遇到问题?
【发布时间】:2021-01-24 17:33:11
【问题描述】:

在我的第一次测试中,我真的不明白 typeError 是什么。有人可以看看is并告诉我问题是什么。

enter image description here enter image description here

【问题讨论】:

  • 嗨,欢迎来到 SO !请尝试将您的相关代码作为实际文本包含在帖子中,而不仅仅是图像。

标签: javascript blockchain ethereum solidity smartcontracts


【解决方案1】:

您的代码中有一个小错字,也许这已经解决了您的问题:

在您编写的代码中:

let LifeInsurance = null;

/* and then */
lifeInsurance = await LifeInsurance.deployed();

注意 LifeInsurance 与 lifeInsurance 的小错字

我认为你的代码应该是这样的

let lifeInsurance = null; // small "L" here

/* and then */
lifeInsurance = await LifeInsurance.deployed();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-10-17
    • 2010-12-27
    • 1970-01-01
    • 1970-01-01
    • 2014-06-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多