hardhat-graph-protocol
Version:
A hardhat plugin that extends the runtime environment to inject additional functionality related to the usage of the Graph Protocol.
41 lines • 2.13 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const deployments_1 = require("@graphprotocol/toolshed/deployments");
const chai_1 = require("chai");
const path_1 = __importDefault(require("path"));
const helpers_1 = require("./helpers");
describe('GRE usage', function () {
describe('Project not using GRE', function () {
(0, helpers_1.useHardhatProject)('default-config', 'mainnet');
it('should throw when accessing hre.graph()', function () {
(0, chai_1.expect)(() => this.hre.graph()).to.throw();
});
});
describe(`Project using GRE - graph path`, function () {
it('should add the graph path to the config', function () {
this.hre = (0, helpers_1.loadHardhatContext)('no-path-config', 'mainnet');
chai_1.assert.equal(this.hre.config.paths.graph, path_1.default.join(__dirname, 'fixtures/no-path-config'));
});
it('should add the graph path to the config from custom path', function () {
this.hre = (0, helpers_1.loadHardhatContext)('path-config', 'mainnet');
chai_1.assert.equal(this.hre.config.paths.graph, path_1.default.join(__dirname, 'fixtures/files'));
});
});
describe(`Project using GRE - deployments`, function () {
(0, helpers_1.useHardhatProject)('path-config', 'arbitrumSepolia');
it.skip('should load Horizon deployment', function () {
const graph = this.hre.graph();
chai_1.assert.isDefined(graph.horizon);
chai_1.assert.isObject(graph.horizon);
chai_1.assert.isDefined(graph.horizon.contracts);
chai_1.assert.isObject(graph.horizon.contracts);
chai_1.assert.isDefined(graph.horizon.addressBook);
chai_1.assert.isObject(graph.horizon.addressBook);
chai_1.assert.instanceOf(graph.horizon.addressBook, deployments_1.GraphHorizonAddressBook);
});
});
});
//# sourceMappingURL=gre.test.js.map