-
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.
Extend library refs processing, fix in error messages for
setUp
(#861)
* Process library refs in both `bytecode` and `deployed_bytecode`; fix error message in case of a failed `init`, `setUp` * Update expected output for new test * Minor typo fix * Formatting * Formatting for quotes * Run `ExternalNestedLibraryTest.testExtLibs()` in `test_foundry_init_code` --------- Co-authored-by: Andrei Văcaru <16517508+anvacaru@users.noreply.github.com>
- Loading branch information
1 parent
9fa22ce
commit 05934f6
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