SolidityNatspecJSON: Manual conversion of two test cases that would not be handled correctly by the script

- dev_multiple_params_mixed_whitespace has whitespace that is not completely preserved
- dev_explicit_inherit_complex is a multi-file test
This commit is contained in:
Kamil Śliwak
2023-09-11 18:06:42 +02:00
parent 1041f071f0
commit ba019e5a01
3 changed files with 69 additions and 94 deletions
@@ -0,0 +1,45 @@
==== Source: Interfaces.sol ====
interface ERC20 {
/// Transfer ``amount`` from ``msg.sender`` to ``to``.
/// @dev test
/// @param to address to transfer to
/// @param amount amount to transfer
function transfer(address to, uint amount) external returns (bool);
}
interface ERC21 {
/// Transfer ``amount`` from ``msg.sender`` to ``to``.
/// @dev test2
/// @param to address to transfer to
/// @param amount amount to transfer
function transfer(address to, uint amount) external returns (bool);
}
==== Source: Testfile.sol ====
import "Interfaces.sol" as myInterfaces;
contract Token is myInterfaces.ERC20, myInterfaces.ERC21 {
/// @inheritdoc myInterfaces.ERC20
function transfer(address too, uint amount)
override(myInterfaces.ERC20, myInterfaces.ERC21) external returns (bool) {
return false;
}
}
// ----
// ----
// Testfile.sol:Token devdoc
// {
// "methods":
// {
// "transfer(address,uint256)":
// {
// "details": "test",
// "params":
// {
// "amount": "amount to transfer",
// "to": "address to transfer to"
// }
// }
// }
// }
@@ -0,0 +1,24 @@
contract test {
/// @dev Multiplies a number by 7 and adds second parameter
/// @param a Documentation for the first parameter
/// @param second Documentation for the second parameter
function mul(uint a, uint second) public returns (uint d) { return a * 7 + second; }
}
// ----
// ----
// :test devdoc
// {
// "methods":
// {
// "mul(uint256,uint256)":
// {
// "details": "Multiplies a number by 7 and adds second parameter",
// "params":
// {
// "a": "Documentation for the first parameter",
// "second": "Documentation for the second parameter"
// }
// }
// }
// }