From 11dba7bd54925a398871bd8e3e18db19d2d13094 Mon Sep 17 00:00:00 2001 From: Ana Julia Date: Tue, 27 Jun 2023 21:24:23 -0300 Subject: [PATCH] Fixing upgrade tests --- scripts/config/protocol-parameters.js | 6 +++--- test/domain/AuthTokenTest.js | 5 ----- test/util/upgrade.js | 10 +++++----- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/scripts/config/protocol-parameters.js b/scripts/config/protocol-parameters.js index 6fc9ceab7..c222d16c6 100644 --- a/scripts/config/protocol-parameters.js +++ b/scripts/config/protocol-parameters.js @@ -20,13 +20,13 @@ module.exports = { maxOffersPerBatch: "12", maxTokensPerWithdrawal: "125", maxFeesPerDisputeResolver: "75", - maxEscalationResponsePeriod: ninetyDays, + maxEscalationResponsePeriod: ninetyDays.toString(), maxDisputesPerBatch: "75", maxAllowedSellers: "140", maxTotalOfferFeePercentage: "10000", // 100% maxRoyaltyPecentage: "10000", //100% - maxResolutionPeriod: ninetyDays, - minDisputePeriod: oneWeek, + maxResolutionPeriod: ninetyDays.toString(), + minDisputePeriod: oneWeek.toString(), maxPremintedVouchers: "10000", }, diff --git a/test/domain/AuthTokenTest.js b/test/domain/AuthTokenTest.js index d7130bb68..199304638 100644 --- a/test/domain/AuthTokenTest.js +++ b/test/domain/AuthTokenTest.js @@ -43,11 +43,6 @@ describe("AuthToken", function () { expect(authToken.tokenIdIsValid()).is.false; expect(authToken.isValid()).is.false; - // Invalid field value - authToken.tokenId = new Date(); - expect(authToken.tokenIdIsValid()).is.false; - expect(authToken.isValid()).is.false; - // Valid field value authToken.tokenId = "0"; expect(authToken.tokenIdIsValid()).is.true; diff --git a/test/util/upgrade.js b/test/util/upgrade.js index 9b3963395..cb4b42d73 100644 --- a/test/util/upgrade.js +++ b/test/util/upgrade.js @@ -2,8 +2,6 @@ const shell = require("shelljs"); const _ = require("lodash"); const { getStorageAt } = require("@nomicfoundation/hardhat-network-helpers"); const hre = require("hardhat"); -const ethers = hre.ethers; - const { keccak256, formatBytes32String, @@ -15,7 +13,7 @@ const { toUtf8Bytes, getContractFactory, getSigners, -} = ethers; +} = hre.ethers; const AuthToken = require("../../scripts/domain/AuthToken"); const { getMetaTransactionsHandlerFacetInitArgs } = require("../../scripts/config/facet-deploy.js"); const AuthTokenType = require("../../scripts/domain/AuthTokenType"); @@ -95,7 +93,8 @@ async function deploySuite(deployer, newVersion) { shell.exec(`git fetch --force --tags origin`); console.log(`Checking out version ${tag}`); shell.exec(`rm -rf contracts/*`); - shell.exec(`git checkout ${tag} contracts`); + shell.exec(`git checkout ${tag} -- "contracts/**`); + if (scriptsTag) { console.log(`Checking out scripts on version ${scriptsTag}`); shell.exec(`rm -rf scripts/*`); @@ -121,7 +120,7 @@ async function deploySuite(deployer, newVersion) { // Get AccessController abstraction const accessControllerInfo = contractsFile.contracts.find((i) => i.name === "AccessController"); - const accessController = await getContractAt("AccessController", await accessControllerInfo.getAddress()); + const accessController = await getContractAt("AccessController", accessControllerInfo.address); // Temporarily grant UPGRADER role to deployer account await accessController.grantRole(Role.UPGRADER, await deployer.getAddress()); @@ -374,6 +373,7 @@ async function populateProtocolContract( await accountHandler .connect(connectedWallet) .createDisputeResolver(disputeResolver, disputeResolverFees, sellerAllowList); + console.log("after"); DRs.push({ wallet: connectedWallet, id: disputeResolver.id,