-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into release
- Loading branch information
Showing
6 changed files
with
264 additions
and
47 deletions.
There are no files selected for viewing
This file contains 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 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 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
28 changes: 28 additions & 0 deletions
28
src/tests/integration/test-data/foundry/test/ExternalNestedLibraryTest.t.sol
This file contains 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,28 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.13; | ||
|
||
import {Test, console} from "forge-std/Test.sol"; | ||
|
||
library LibrarySum { | ||
function sum(uint256 a, uint256 b) external pure returns (uint256 res) { | ||
res = a + b; | ||
} | ||
} | ||
|
||
library LibraryEq { | ||
function eq(uint256 a, uint256 b, uint256 c) internal returns (bool res) { | ||
uint256 sum = LibrarySum.sum(a, b); | ||
return (sum == c); | ||
} | ||
} | ||
|
||
contract ExternalNestedLibraryTest is Test { | ||
uint256 public z = 10; | ||
|
||
function testExtLibs() public { | ||
uint256 x = 3; | ||
uint256 y = 7; | ||
bool res = LibraryEq.eq(x, y, z); | ||
assert(res); | ||
} | ||
} |
This file contains 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 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