diff --git a/CHANGELOG.md b/CHANGELOG.md index 074ef788..a3891be9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +## [4.1.5] + +### Added + +- Added **PresetCompleted** event to MaxBalanceModule, which is triggered when the presetCompleted function is called. + ## [4.1.4] ### Added diff --git a/contracts/compliance/modular/modules/MaxBalanceModule.sol b/contracts/compliance/modular/modules/MaxBalanceModule.sol index 53751a47..2d39116d 100644 --- a/contracts/compliance/modular/modules/MaxBalanceModule.sol +++ b/contracts/compliance/modular/modules/MaxBalanceModule.sol @@ -92,6 +92,8 @@ contract MaxBalanceModule is AbstractModuleUpgradeable { event IDBalancePreSet(address indexed _compliance, address indexed _id, uint256 _balance); + event PresetCompleted(address indexed _compliance); + /// errors error MaxBalanceExceeded(address _compliance, uint256 _value); @@ -184,6 +186,7 @@ contract MaxBalanceModule is AbstractModuleUpgradeable { } _compliancePresetStatus[_compliance] = true; + emit PresetCompleted(_compliance); } /** diff --git a/package.json b/package.json index 0ef2ea2a..029ecf50 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tokenysolutions/t-rex", - "version": "4.1.4", + "version": "4.1.5", "description": "A fully compliant environment for the issuance and use of tokenized securities.", "main": "index.js", "directories": { diff --git a/test/compliances/module-max-balance.test.ts b/test/compliances/module-max-balance.test.ts index 73d37199..0453485d 100644 --- a/test/compliances/module-max-balance.test.ts +++ b/test/compliances/module-max-balance.test.ts @@ -234,8 +234,8 @@ describe('Compliance Module: MaxBalance', () => { const context = await loadFixture(deployComplianceFixture); const complianceModule = await ethers.deployContract('MaxBalanceModule'); - await complianceModule.connect(context.accounts.deployer).presetCompleted(context.suite.compliance.address); - + const tx = await complianceModule.connect(context.accounts.deployer).presetCompleted(context.suite.compliance.address); + await expect(tx).to.emit(complianceModule, 'PresetCompleted').withArgs(context.suite.compliance.address); expect(await complianceModule.canComplianceBind(context.suite.compliance.address)).to.be.true; }); });