Skip to content

Commit

Permalink
feat: intermediary mocks (allo-protocol#656)
Browse files Browse the repository at this point in the history
* test: add a few test cases

* test: add more unit test cases

* test: add more test cases

* chore: add smock to CI

* test: fix broken test case

* fix: format

* test: create mock file for smock, fix TODOs

* test: solve all TODOs

* fix: fmt

* fix: CI

* docs: add readme file on intermediary mocks folder

* feat: move milestone mock to intermediary mocks folder

* feat: move recipient mock to intermediary mocks folder

* fix: skipped tests

* feat: move intermediary mocks folder

* test: optimize and remove MockERC20

* fix: natspec linting
  • Loading branch information
0xAustrian authored Sep 5, 2024
1 parent fddd459 commit 3d2473b
Show file tree
Hide file tree
Showing 15 changed files with 319 additions and 670 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ abstract contract AllocatorsAllowlistExtension is AllocationExtension, IAllocato
}

/// @dev Mark an address as valid allocator
/// @param _allocator The allocator address to add
function _addAllocator(address _allocator) internal virtual {
allowedAllocators[_allocator] = true;
}

/// @dev Remove an address from the valid allocators
/// @param _allocator The allocator address to remove
function _removeAllocator(address _allocator) internal virtual {
allowedAllocators[_allocator] = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ abstract contract MilestonesExtension is BaseStrategy, IMilestonesExtension {
/// @notice This initializes the Milestones Extension
/// @dev This function MUST be called by the 'initialize' function in the strategy.
/// @param _maxBid The initialize params
function __MilestonesExtension_init(uint256 _maxBid) internal {
function __MilestonesExtension_init(uint256 _maxBid) internal virtual {
// Set the strategy specific variables
_increaseMaxBid(_maxBid);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ abstract contract RecipientsExtension is BaseStrategy, Errors, IRecipientsExtens
/// @param _rowIndex Row index in the statusesBitMap mapping
/// @param _fullRow New row of statuses
/// @return The _fullRow with any modifications made by _reviewRecipientStatus()
function _processStatusRow(uint256 _rowIndex, uint256 _fullRow) internal returns (uint256) {
function _processStatusRow(uint256 _rowIndex, uint256 _fullRow) internal virtual returns (uint256) {
// Loop through each status in the updated row
uint256 currentRow = statusesBitMap[_rowIndex];
for (uint256 col = 0; col < 64; ++col) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"/////// deploy-test ///////": "echo 'deploy test scripts'",
"create-profile": "npx hardhat run scripts/test/createProfile.ts --network",
"create-pool": "npx hardhat run scripts/test/createPool.ts --network",
"smock": "smock-foundry --contracts contracts/core --contracts test/utils/mocks/"
"smock": "smock-foundry --contracts contracts/core --contracts test/mocks/smock-mocks/"
},
"devDependencies": {
"@defi-wonderland/natspec-smells": "1.1.5",
Expand Down
69 changes: 0 additions & 69 deletions test/mocks/MockERC20.sol

This file was deleted.

Loading

0 comments on commit 3d2473b

Please sign in to comment.