Skip to content

Commit

Permalink
Add preset completed event to max balance module (#225)
Browse files Browse the repository at this point in the history
* Add preset completed event to max balance module

* Fix lint

* Update package version
  • Loading branch information
aliarbak authored Sep 11, 2024
1 parent d34e5c5 commit 8771358
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions contracts/compliance/modular/modules/MaxBalanceModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -184,6 +186,7 @@ contract MaxBalanceModule is AbstractModuleUpgradeable {
}

_compliancePresetStatus[_compliance] = true;
emit PresetCompleted(_compliance);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions test/compliances/module-max-balance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
});
Expand Down

0 comments on commit 8771358

Please sign in to comment.