Skip to content

Commit 85b21f8

Browse files
committed
fix tests
1 parent 2998193 commit 85b21f8

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

packages/hardhat-chai-matchers/src/internal/addressable.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function override(
2626
// so we are looking for a sync way of getting the address. If an address was recovered, it is returned as a string,
2727
// otherwise undefined is returned.
2828
function tryGetAddressSync(value: any): string | undefined {
29-
value = Typed.dereference(value, 'address');
29+
value = Typed.dereference(value, "address");
3030
if (isAddress(value)) {
3131
return value;
3232
} else if (isAddressable(value)) {

packages/hardhat-chai-matchers/test/addressable.ts

+19-7
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ describe("Addressable matcher", () => {
1414
const otherSigner = ethers.Wallet.createRandom();
1515
const otherAddress = otherSigner.address;
1616
const otherContract = new ethers.Contract(otherAddress, []);
17-
const otherTypedAddress = ethers.Typed.address(address);
18-
const otherTypedSigner = ethers.Typed.address(signer);
19-
const otherTypedContract = ethers.Typed.address(contract);
17+
const otherTypedAddress = ethers.Typed.address(otherAddress);
18+
const otherTypedSigner = ethers.Typed.address(otherSigner);
19+
const otherTypedContract = ethers.Typed.address(otherContract);
2020

2121
const elements = [
2222
{ name: "address", object: address, class: address },
@@ -27,10 +27,22 @@ describe("Addressable matcher", () => {
2727
{ name: "typed contract", object: typedContract, class: address },
2828
{ name: "other address", object: otherAddress, class: otherAddress },
2929
{ name: "other signer", object: otherSigner, class: otherAddress },
30-
{ name: "other contract", object: otherContract, class: otherAddress },
31-
{ name: "other typed address", object: otherTypedAddress, class: otherAddress },
32-
{ name: "other typed signer", object: otherTypedSigner, class: otherAddress },
33-
{ name: "other typed contract", object: otherTypedContract, class: otherAddress },
30+
{ name: " other contract", object: otherContract, class: otherAddress },
31+
{
32+
name: "other typed address",
33+
object: otherTypedAddress,
34+
class: otherAddress,
35+
},
36+
{
37+
name: "other typed signer",
38+
object: otherTypedSigner,
39+
class: otherAddress,
40+
},
41+
{
42+
name: "other typed contract",
43+
object: otherTypedContract,
44+
class: otherAddress,
45+
},
3446
];
3547

3648
for (const el1 of elements)

0 commit comments

Comments
 (0)