-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(json-abi): `Param.ty` is not always a valid `TypeSpecifier` * fix: workaround in type parser too * test: better test case for this * chore: remove earlier workaround * chore: simplify workaround
- Loading branch information
Showing
6 changed files
with
85 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"inputs":[{"internalType":"enum EnumsInLibraryFunctions.TheEnum[2]","name":"x","type":"EnumsInLibraryFunctions.TheEnum[2]"}],"name":"enumArray","outputs":[{"internalType":"enum EnumsInLibraryFunctions.TheEnum[2]","name":"","type":"EnumsInLibraryFunctions.TheEnum[2]"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"enum EnumsInLibraryFunctions.TheEnum[][69][]","name":"x","type":"EnumsInLibraryFunctions.TheEnum[][69][]"}],"name":"enumArrays","outputs":[{"internalType":"enum EnumsInLibraryFunctions.TheEnum[][69][]","name":"","type":"EnumsInLibraryFunctions.TheEnum[][69][]"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"enum EnumsInLibraryFunctions.TheEnum[]","name":"x","type":"EnumsInLibraryFunctions.TheEnum[]"}],"name":"enumDynArray","outputs":[{"internalType":"enum EnumsInLibraryFunctions.TheEnum[]","name":"","type":"EnumsInLibraryFunctions.TheEnum[]"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"enum EnumsInLibraryFunctions.TheEnum","name":"x","type":"EnumsInLibraryFunctions.TheEnum"}],"name":"enum_","outputs":[{"internalType":"enum EnumsInLibraryFunctions.TheEnum","name":"","type":"EnumsInLibraryFunctions.TheEnum"}],"stateMutability":"pure","type":"function"}] |
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
24 changes: 24 additions & 0 deletions
24
crates/syn-solidity/tests/contracts/EnumsInLibraryFunctions.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,24 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.13; | ||
|
||
library EnumsInLibraryFunctions { | ||
enum TheEnum { | ||
DoesntMatter | ||
} | ||
|
||
function enum_(TheEnum x) external pure returns (TheEnum) { | ||
return x; | ||
} | ||
|
||
function enumDynArray(TheEnum[] memory x) external pure returns (TheEnum[] memory) { | ||
return x; | ||
} | ||
|
||
function enumArray(TheEnum[2] memory x) external pure returns (TheEnum[2] memory) { | ||
return x; | ||
} | ||
|
||
function enumArrays(TheEnum[][69][] memory x) external pure returns (TheEnum[][69][] memory) { | ||
return x; | ||
} | ||
} |