diff --git a/scripts/migrations/migrate_2.2.1.js b/scripts/migrations/migrate_2.2.1.js index 091943127..e1093c4d3 100644 --- a/scripts/migrations/migrate_2.2.1.js +++ b/scripts/migrations/migrate_2.2.1.js @@ -27,7 +27,7 @@ async function migrate(env) { console.log(`Migration ${tag} started`); try { console.log("Removing any local changes before upgrading"); - shell.exec(`git reset`); + shell.exec(`git reset @{u}`); const statusOutput = shell.exec("git status -s -uno scripts"); if (statusOutput.stdout) { diff --git a/test/protocol/ConfigHandlerTest.js b/test/protocol/ConfigHandlerTest.js index 4d3db493f..655e50b15 100644 --- a/test/protocol/ConfigHandlerTest.js +++ b/test/protocol/ConfigHandlerTest.js @@ -158,46 +158,10 @@ describe("IBosonConfigHandler", function () { .to.emit(configHandler, "ProtocolFeeFlatBosonChanged") .withArgs(protocolFeeFlatBoson, deployer.address); - await expect(cutTransaction) - .to.emit(configHandler, "MaxExchangesPerBatchChanged") - .withArgs(maxExchangesPerBatch, deployer.address); - - await expect(cutTransaction) - .to.emit(configHandler, "MaxOffersPerGroupChanged") - .withArgs(maxOffersPerGroup, deployer.address); - - await expect(cutTransaction) - .to.emit(configHandler, "MaxTwinsPerBundleChanged") - .withArgs(maxTwinsPerBundle, deployer.address); - - await expect(cutTransaction) - .to.emit(configHandler, "MaxOffersPerBundleChanged") - .withArgs(maxOffersPerBundle, deployer.address); - - await expect(cutTransaction) - .to.emit(configHandler, "MaxOffersPerBatchChanged") - .withArgs(maxOffersPerBatch, deployer.address); - - await expect(cutTransaction) - .to.emit(configHandler, "MaxTokensPerWithdrawalChanged") - .withArgs(maxTokensPerWithdrawal, deployer.address); - - await expect(cutTransaction) - .to.emit(configHandler, "MaxFeesPerDisputeResolverChanged") - .withArgs(maxFeesPerDisputeResolver, deployer.address); - await expect(cutTransaction) .to.emit(configHandler, "MaxEscalationResponsePeriodChanged") .withArgs(maxEscalationResponsePeriod, deployer.address); - await expect(cutTransaction) - .to.emit(configHandler, "MaxDisputesPerBatchChanged") - .withArgs(maxDisputesPerBatch, deployer.address); - - await expect(cutTransaction) - .to.emit(configHandler, "MaxAllowedSellersChanged") - .withArgs(maxAllowedSellers, deployer.address); - await expect(cutTransaction) .to.emit(configHandler, "BuyerEscalationFeePercentageChanged") .withArgs(buyerEscalationDepositPercentage, deployer.address); @@ -213,10 +177,6 @@ describe("IBosonConfigHandler", function () { await expect(cutTransaction) .to.emit(configHandler, "MinDisputePeriodChanged") .withArgs(minDisputePeriod, deployer.address); - - await expect(cutTransaction) - .to.emit(configHandler, "MaxPremintedVouchersChanged") - .withArgs(maxPremintedVouchers, deployer.address); }); }); }); diff --git a/test/protocol/ProtocolInitializationHandlerTest.js b/test/protocol/ProtocolInitializationHandlerTest.js index 1b224ea58..7da3d1712 100644 --- a/test/protocol/ProtocolInitializationHandlerTest.js +++ b/test/protocol/ProtocolInitializationHandlerTest.js @@ -1,6 +1,7 @@ const { expect } = require("chai"); const hre = require("hardhat"); const ethers = hre.ethers; +const { keccak256, toUtf8Bytes } = ethers.utils; const Role = require("../../scripts/domain/Role"); const { deployProtocolDiamond } = require("../../scripts/util/deploy-protocol-diamond.js"); @@ -12,6 +13,7 @@ const { getFacetAddCut, getFacetReplaceCut } = require("../../scripts/util/diamo const { RevertReasons } = require("../../scripts/config/revert-reasons.js"); const { getFacetsWithArgs } = require("../util/utils.js"); const { getV2_2_0DeployConfig } = require("../upgrade/00_config.js"); +const { getStorageAt } = require("@nomicfoundation/hardhat-network-helpers"); describe("ProtocolInitializationHandler", async function () { // Common vars @@ -56,7 +58,7 @@ describe("ProtocolInitializationHandler", async function () { version = "2.2.0"; // initialization data for v2.2.0 - maxPremintedVouchers = "1000"; + maxPremintedVouchers = "10000"; initializationData = ethers.utils.defaultAbiCoder.encode(["uint256"], [maxPremintedVouchers]); }); @@ -466,8 +468,10 @@ describe("ProtocolInitializationHandler", async function () { await getFees(maxPriorityFeePerGas) ); - // Verify that new value is stored - expect(await configHandler.connect(rando).getMaxPremintedVouchers()).to.equal(maxPremintedVouchers); + const protocolLimitsSlot = ethers.BigNumber.from(keccak256(toUtf8Bytes("boson.protocol.limits"))); + const maxPremintedVoucherStorage = await getStorageAt(diamondCutFacet.address, protocolLimitsSlot.add(4)); + + expect(ethers.BigNumber.from(maxPremintedVoucherStorage).toString()).to.equal(maxPremintedVouchers); }); context("💔 Revert Reasons", async function () {