-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add unit tests for internal _credit function
#62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
9120dc5
feat: Implement IexecLayerZeroBridgeHarness and refactor deployment s…
Le-Caignec bf05f1b
feat: Add IexecLayerZeroBridgeHarness test suite for enhanced cross-c…
Le-Caignec 9dc52a1
feat: Refactor deployment results and update test contracts for Layer…
Le-Caignec c79968a
feat: Update IexecLayerZeroBridge tests to use harness and remove obs…
Le-Caignec 90c48cf
Merge branch 'main' into feature/add-unit-tests-for-_mint-function
Le-Caignec 6ff1736
Merge branch 'main' into feature/add-unit-tests-for-_mint-function
Le-Caignec 21f67b1
feat: Remove unused import from IexecLayerZeroBridge test file
Le-Caignec 62f3ee5
feat: Add event emission expectations for CrosschainMint in IexecLaye…
Le-Caignec 515c01b
Merge remote-tracking branch 'origin/main' into feature/add-unit-test…
Le-Caignec 960acd0
refactor: Rename test functions for clarity on paused states
Le-Caignec 6ee5934
refactor: Update token type from RLCMock to IERC20 for improved inter…
Le-Caignec 218e43f
Merge branch 'main' into feature/add-unit-tests-for-_mint-function
Le-Caignec 713fcfc
Merge remote-tracking branch 'origin/main' into feature/add-unit-test…
Le-Caignec 21b37f0
fix: Correct parameter order in UUPSProxyDeployer deployment
Le-Caignec 090d5a5
fix: Use dynamic contract name for IexecLayerZeroBridge deployment
Le-Caignec efd97f5
refactor: Simplify liquidity unifier and crosschain token deployment …
Le-Caignec 7878f71
fix: Update Forge build command to include size analysis for source f…
Le-Caignec fd25e94
test ci
Le-Caignec cbffc8b
fix: Add environment file copy step after Forge build
Le-Caignec 67f778a
Merge branch 'main' into feature/add-unit-tests-for-_mint-function
Le-Caignec d9cbc1d
Update test/units/bridges/layerZero/IexecLayerZeroBridge.t.sol
Le-Caignec 34dbb20
Update test/units/bridges/layerZero/IexecLayerZeroBridge.t.sol
Le-Caignec 49f461c
refactor: rename fuzz test for credit function to clarify address han…
Le-Caignec 795cf82
fix: correct expected emit address in credit function test
Le-Caignec f3db488
refactor: comment out existing tests for send functionality and credi…
Le-Caignec c5836a9
refactor: update variable names for IexecLayerZeroBridge to improve c…
Le-Caignec c57974a
fix: uncomment
Le-Caignec f076db0
test: uncomment tests
Le-Caignec cda19cd
Update test/units/bridges/layerZero/IexecLayerZeroBridge.t.sol
zguesmi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zguesmi marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // SPDX-FileCopyrightText: 2025 IEXEC BLOCKCHAIN TECH <contact@iex.ec> | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| pragma solidity ^0.8.22; | ||
|
|
||
| import {IexecLayerZeroBridge} from "../bridges/layerZero/IexecLayerZeroBridge.sol"; | ||
|
|
||
| contract IexecLayerZeroBridgeHarness is IexecLayerZeroBridge { | ||
| constructor(bool approvalRequired_, address bridgeableToken, address lzEndpoint) | ||
| IexecLayerZeroBridge(approvalRequired_, bridgeableToken, lzEndpoint) | ||
| {} | ||
|
|
||
| function exposed_debit(address from, uint256 amountLD, uint256 minAmountLD, uint32 dstEid) | ||
| external | ||
| returns (uint256 amountSentLD, uint256 amountReceivedLD) | ||
| { | ||
| return _debit(from, amountLD, minAmountLD, dstEid); | ||
| } | ||
|
|
||
| function exposed_credit(address to, uint256 amountLD, uint32 srcEid) external returns (uint256 amountReceivedLD) { | ||
| return _credit(to, amountLD, srcEid); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,17 +22,27 @@ contract IexecLayerZeroBridgeUpgradeTest is TestHelperOz5 { | |
| address public pauser = makeAddr("pauser"); | ||
|
|
||
| address public proxyAddress; | ||
| string public name = "iEx.ec Network Token"; | ||
| string public symbol = "RLC"; | ||
|
Comment on lines
-25
to
-26
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding those two string memory variables into our utils library caused a |
||
| uint256 public constant NEW_STATE_VARIABLE = 2; | ||
|
|
||
| function setUp() public virtual override { | ||
| super.setUp(); | ||
| setUpEndpoints(2, LibraryType.UltraLightNode); | ||
| mockEndpoint = address(endpoints[1]); | ||
|
|
||
| (, iexecLayerZeroBridgeV1,, rlcCrosschainToken,) = | ||
| TestUtils.setupDeployment(name, symbol, mockEndpoint, mockEndpoint, admin, upgrader, pauser); | ||
| TestUtils.DeploymentResult memory deploymentResult1 = TestUtils.setupDeployment( | ||
| TestUtils.DeploymentParams({ | ||
| iexecLayerZeroBridgeContractName: "IexecLayerZeroBridge", | ||
| lzEndpointSource: mockEndpoint, | ||
| lzEndpointDestination: mockEndpoint, | ||
| initialAdmin: admin, | ||
| initialUpgrader: upgrader, | ||
| initialPauser: pauser | ||
| }) | ||
| ); | ||
|
|
||
| iexecLayerZeroBridgeV1 = deploymentResult1.iexecLayerZeroBridgeChainWithoutApproval; | ||
| rlcCrosschainToken = deploymentResult1.rlcCrosschainToken; | ||
|
|
||
| proxyAddress = address(iexecLayerZeroBridgeV1); | ||
| } | ||
|
|
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.