You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Sablier V2, we've applied this heuristic whereby the final leaves in the tree result in a Solidity test that bears the name of the function itself. Here's an example:
The rationale is that the final leaf is in many ways the "happiest of all happy paths", i.e., what the developer hopes the user's txs will end up effecting in the vast majority of cases. It is thus helpful to give this leaf a privilege; separately, it may also be useful when visualizing a gas snapshot/ report.
Since tree files must begin with the name of the test contract (#3), the name of the function could be extracted from there by removing the Test suffix.
Input
Given the following tree:
SimpleBranchTest
├── when x is false
│ └── it should revert
└── when x is true
└── it should return x
Output
I would like bulloak scaffold to produce the following output:
pragma solidity0.8.0;
contractSimpleBranchTest {
function test_RevertWhen_XIsFalse() external {
// it should revert
}
modifier whenXIsTrue() {
_;
}
function test_SimpleBranch() external whenXIsTrue {
// it should return x
}
}
The text was updated successfully, but these errors were encountered:
Context
In Sablier V2, we've applied this heuristic whereby the final leaves in the tree result in a Solidity test that bears the name of the function itself. Here's an example:
https://github.com/sablier-labs/v2-core/blob/52df5c15da76e47ca396fcf4986fefade0db237f/test/integration/concrete/comptroller/set-protocol-fee/setProtocolFee.t.sol#L43
The rationale is that the final leaf is in many ways the "happiest of all happy paths", i.e., what the developer hopes the user's txs will end up effecting in the vast majority of cases. It is thus helpful to give this leaf a privilege; separately, it may also be useful when visualizing a gas snapshot/ report.
Since tree files must begin with the name of the test contract (#3), the name of the function could be extracted from there by removing the
Test
suffix.Input
Given the following tree:
Output
I would like
bulloak scaffold
to produce the following output:The text was updated successfully, but these errors were encountered: