我在为 Solidity 合同编写测试时遇到问题?

问题描述

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

enter image description here enter image description here

解决方法

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

在您编写的代码中:

let LifeInsurance = null;

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

注意 LifeInsurance 与 lifeInsurance 的小错别字

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

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

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