diff --git a/test/NodeDriver.ts b/test/NodeDriver.ts index a96cb8c..8baf3dc 100644 --- a/test/NodeDriver.ts +++ b/test/NodeDriver.ts @@ -1,12 +1,15 @@ -import { ethers } from 'hardhat'; +import { ethers, upgrades } from 'hardhat'; import { expect } from 'chai'; import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; -import { IEVMWriter, NetworkInitializer, NodeDriver, NodeDriverAuth, UnitTestSFC } from '../typechain-types'; +import { IEVMWriter, NetworkInitializer, NodeDriver, NodeDriverAuth } from '../typechain-types'; describe('NodeDriver', () => { const fixture = async () => { const [owner, nonOwner] = await ethers.getSigners(); - const sfc: UnitTestSFC = await ethers.deployContract('UnitTestSFC'); + const sfc = await upgrades.deployProxy(await ethers.getContractFactory('UnitTestSFC'), { + kind: 'uups', + initializer: false, + }); const nodeDriver: NodeDriver = await ethers.deployContract('NodeDriver'); const evmWriter: IEVMWriter = await ethers.deployContract('StubEvmWriter'); const nodeDriverAuth: NodeDriverAuth = await ethers.deployContract('NodeDriverAuth'); diff --git a/test/SFC.ts b/test/SFC.ts index 07c9570..53f9fbd 100644 --- a/test/SFC.ts +++ b/test/SFC.ts @@ -1,11 +1,10 @@ -import { ethers } from 'hardhat'; +import { ethers, upgrades } from 'hardhat'; import { expect } from 'chai'; import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { IEVMWriter, NodeDriver, NodeDriverAuth, - UnitTestSFC, UnitTestConstantsManager, UnitTestNetworkInitializer, } from '../typechain-types'; @@ -15,7 +14,10 @@ import { BlockchainNode, ValidatorMetrics } from './helpers/BlockchainNode'; describe('SFC', () => { const fixture = async () => { const [owner, user] = await ethers.getSigners(); - const sfc: UnitTestSFC = await ethers.deployContract('UnitTestSFC'); + const sfc = await upgrades.deployProxy(await ethers.getContractFactory('UnitTestSFC'), { + kind: 'uups', + initializer: false, + }); const nodeDriver: NodeDriver = await ethers.deployContract('NodeDriver'); const evmWriter: IEVMWriter = await ethers.deployContract('StubEvmWriter'); const nodeDriverAuth: NodeDriverAuth = await ethers.deployContract('NodeDriverAuth'); @@ -241,11 +243,6 @@ describe('SFC', () => { expect(await this.sfc.owner()).to.equal(this.owner); }); - it('Should succeed and return true if the caller is the owner of the contract', async function () { - expect(await this.sfc.isOwner()).to.equal(true); - expect(await this.sfc.connect(this.user).isOwner()).to.equal(false); - }); - it('Should succeed and return address(0) if owner leaves the contract without owner', async function () { expect(await this.sfc.owner()).to.equal(this.owner); await this.sfc.renounceOwnership();