Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Fix some problems with the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
haltman-at committed Feb 13, 2023
1 parent 9bbbe11 commit 237090b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions packages/debugger/test/data/ens.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ contract EnsTest {
registryAddress = _registryAddress;
}
event Named(address);
function run() public {
emit Named(namedAddress); //make use of the variable so debugger can see it
}
}
`;
Expand Down Expand Up @@ -61,7 +64,7 @@ describe("ENS", function () {
quiet: true
},
miner: {
instamine: "strict",
instamine: "eager", //this isn't ideal, but these tests don't work otherwise?
blockGasLimit: testBlockGasLimit
}
});
Expand All @@ -79,10 +82,12 @@ describe("ENS", function () {
abstractions = prepared.abstractions;
compilations = prepared.compilations;

registryAddress = await abstractions.EnsTest.registryAddress();
const deployedContract = await abstractions.EnsTest.deployed();
registryAddress = await deployedContract.registryAddress();
});

it("Includes ENS names for addresses", async function () {
this.timeout(8000);
const instance = await abstractions.EnsTest.deployed();
const receipt = await instance.run();
const txHash = receipt.tx;
Expand All @@ -97,6 +102,7 @@ describe("ENS", function () {

const namedAddressResult = await bugger.variable("namedAddress");

debug("what we got: %O", namedAddressResult);
assert.property(namedAddressResult.interpretations, "ensName");
assert.equal(namedAddressResult.interpretations.ensName.kind, "valid");
assert.equal(
Expand All @@ -106,6 +112,7 @@ describe("ENS", function () {
});

it("Does not include ENS names when turned off", async function () {
this.timeout(8000);
const instance = await abstractions.EnsTest.deployed();
const receipt = await instance.run();
const txHash = receipt.tx;
Expand All @@ -120,6 +127,7 @@ describe("ENS", function () {

const namedAddressResult = await bugger.variable("namedAddress");

debug("what we got: %O", namedAddressResult);
assert.notProperty(namedAddressResult.interpretations, "ensName");
});
});
2 changes: 1 addition & 1 deletion packages/decoder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"build": "tsc",
"prepare": "yarn build",
"start": "tsc --watch",
"test": "mocha ./test/current/test/* ./test/legacy/test/* ./test/ens/test/*"
"test": "mocha --exit ./test/current/test/* ./test/legacy/test/* ./test/ens/test/*"
},
"types": "dist/index.d.ts",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/decoder/test/ens/test/ens-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe("ENS reverse resolution", function () {

before("Create Provider", async function () {
provider = Ganache.provider({
miner: { instamine: "strict" },
miner: { instamine: "eager" }, //this isn't ideal, but these tests don't work otherwise?
seed: "decoder",
gasLimit: 7000000,
logging: { quiet: true }
Expand Down

0 comments on commit 237090b

Please sign in to comment.