The swap function in AggregationRouterV5 is like this
/// @notice Performs a swap, delegating all calls encoded in `data` to `executor`. See tests for usage examples
/// @dev router keeps 1 wei of every token on the contract balance for gas optimisations reasons. This affects first swap of every token by leaving 1 wei on the contract.
/// @param executor Aggregation executor that executes calls described in `data`
/// @param desc Swap description
/// @param permit Should contain valid permit that can be used in `IERC20Permit.permit` calls.
/// @param data Encoded calls that `caller` should execute in between of swaps
/// @return returnAmount Resulting token amount
/// @return spentAmount Source token amount
function swap(
IAggregationExecutor executor,
SwapDescription calldata desc,
bytes calldata permit,
bytes calldata data
)
external
payable
returns (
uint256 returnAmount,
uint256 spentAmount
)
{
and i want to know how is data constructed, it's doc just says "see tests for usage example". It confused me, can anyone help?