Skip to content

Commit

Permalink
feat: Receipt's contract address should be null when not deploy contr…
Browse files Browse the repository at this point in the history
…act (#121)

* feat: Receipt's contract address should be null when not deploy contract
  • Loading branch information
classicalliu authored Jun 1, 2022
1 parent 8ce86fb commit 6828c7c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions contracts/test/ContractAddress.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const { assert } = require("chai");
const { ethers, web3 } = require("hardhat");

describe("ContractAddress", function () {
it("Contract address should be null when not deploy contract", async function () {
const Storage = await ethers.getContractFactory("Calc");
const contract = await Storage.deploy();
await contract.deployed();

//Set data
const tx = await contract.store(256);
await tx.wait(2);
const receipt = await web3.eth.getTransactionReceipt(tx.hash);
assert.isNull(receipt.contractAddress);
});
});

0 comments on commit 6828c7c

Please sign in to comment.