Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KyrylR committed Mar 9, 2024
1 parent 4888040 commit 9e4761d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/abigen/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ module.exports = class Generator {

const argv = `abigen --abi ${abiPath} --pkg ${packageName} --type ${contract} --lang ${this.lang} --out ${genPath}`;

this._verboseLog(`Generating bindings: ${argv}`);

this._verboseLog(`${contract}: ${source}`);

if (!fs.existsSync(this.outDir)) {
Expand Down
10 changes: 5 additions & 5 deletions test/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe("GoBind x Hardhat integration", function () {
const assertContractsGenerated = (outdir: string) => {
assertExists(outdir);
assertExists(`${outdir}/contracts`);
assertExists(`${outdir}/contracts/lock/Lock.go`);
assertExists(`${outdir}/contracts/Lock/Lock.go`);
};

describe("Main logic with default config", function () {
Expand Down Expand Up @@ -62,9 +62,9 @@ describe("GoBind x Hardhat integration", function () {
assertNotExists(this.outdir);
});

const contractPaths = ["mock1/Mock1.go", "mock2/Mock2.go"].map((p) => "contracts/" + p);
const interfacePaths = ["imock1/IMock1.go", "imock2/IMock2.go"].map((p) => "contracts/interfaces/" + p);
const dependecyPaths = ["access/ownable/Ownable.go", "utils/context/Context.go"].map(
const contractPaths = ["Mock1/Mock1.go", "Mock2/Mock2.go"].map((p) => "contracts/" + p);
const interfacePaths = ["IMock1/IMock1.go", "IMock2/IMock2.go"].map((p) => "contracts/interfaces/" + p);
const dependecyPaths = ["access/Ownable/Ownable.go", "utils/Context/Context.go"].map(
(p) => "@openzeppelin/contracts/" + p,
);
const allPaths = [...contractPaths, ...interfacePaths, ...dependecyPaths];
Expand Down Expand Up @@ -112,7 +112,7 @@ describe("GoBind x Hardhat integration", function () {
});

it(`for ${caseToString(0)} generates only Ownable.go`, async function () {
const ownablePath = "@openzeppelin/contracts/access/ownable/Ownable.go";
const ownablePath = "@openzeppelin/contracts/access/Ownable/Ownable.go";
this.env.config.gobind.onlyFiles = testCases[0].only;

await this.env.run(TASK_GOBIND, abigenPath);
Expand Down

0 comments on commit 9e4761d

Please sign in to comment.