Skip to content

Commit

Permalink
[TEST] Update Jurisdiction Tests for Upgradable Jurisdictions
Browse files Browse the repository at this point in the history
  • Loading branch information
toledoroy committed May 9, 2022
1 parent 8cb6402 commit a90d910
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ describe("Protocol", function () {
let hubContract: Contract;
let avatarContract: Contract;
let jurisdictionContract: Contract;
let jurisdictionUpContract: Contract;

let actionContract: Contract;
let caseContract: Contract;
// let jurisdictionUpContract: Contract;
// let caseContract: Contract;

//Addresses
let owner: Signer;
Expand Down Expand Up @@ -243,25 +244,23 @@ describe("Protocol", function () {
describe("Jurisdiction", function () {

before(async function () {
//Deploy Jurisdiction
jurisdictionContract = await ethers.getContractFactory("Jurisdiction").then(res => res.deploy(hubContract.address, actionContract.address));
this.jurisdictionContract = jurisdictionContract;

//Deploy Jurisdiction
// jurisdictionContract = await ethers.getContractFactory("Jurisdiction").then(res => res.deploy(hubContract.address, actionContract.address));
// this.jurisdictionContract = jurisdictionContract;

//Simulate to Get New Jurisdiction Address
// let JAddr = await hubContract.callStatic.jurisdictionMake("Test Jurisdiction", test_uri);
let JAddr = await hubContract.callStatic.jurisdictionMake("Test Jurisdiction", test_uri);
// let JAddr = await hubContract.connect(admin).callStatic.jurisdictionMake("Test Jurisdiction", test_uri);

//Create New Jurisdiction
let tx = await hubContract.jurisdictionMake("Test Jurisdiction", test_uri);

//Expect Valid Address
// expect(JAddr).to.be.properAddress;
expect(JAddr).to.be.properAddress;
//Expect Case Created Event
// await expect(tx).to.emit(hubContract, 'ContractCreated').withArgs("jurisdiction", JAddr);
await expect(tx).to.emit(hubContract, 'ContractCreated').withArgs("jurisdiction", JAddr);
//Init Jurisdiction Contract Object
// this.jurisdictionContract = await ethers.getContractFactory("JurisdictionUp").then(res => res.attach(JAddr));

jurisdictionContract = await ethers.getContractFactory("JurisdictionUpgradable").then(res => res.attach(JAddr));
this.jurisdictionContract = jurisdictionContract;
});

it("Users can join as a member", async function () {
Expand Down Expand Up @@ -445,7 +444,6 @@ describe("Protocol", function () {
describe("Case", function () {

it("Should be Created (by Jurisdiction)", async function () {

let caseName = "Test Case #1";
let ruleRefArr = [
{
Expand Down

0 comments on commit a90d910

Please sign in to comment.