Skip to content

Commit

Permalink
fix: cleaner array
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra committed Nov 1, 2023
1 parent 57a9544 commit 9d1a560
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
7 changes: 3 additions & 4 deletions generator/features/__snapshots__/assetListing.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ contract AaveV3Ethereum_Test_20231023_Test is ProtocolV3TestBase {
AaveV3Ethereum_Test_20231023 internal proposal;
function setUp() public {
vm.createSelectFork(vm.rpcUrl('mainnet'), 18480106);
vm.createSelectFork(vm.rpcUrl('mainnet'), 18480118);
proposal = new AaveV3Ethereum_Test_20231023();
}
Expand Down Expand Up @@ -246,9 +246,8 @@ exports[`feature: assetListing > should return reasonable code 1`] = `
{
"code": {
"constants": [
"address public constant PSP = 0xcAfE001067cDEF266AfB7Eb5A286dCFD277f3dE5;
uint256 internal constant PSP_SEED_AMOUNT = 10 ** 18;
",
"address public constant PSP = 0xcAfE001067cDEF266AfB7Eb5A286dCFD277f3dE5;",
"uint256 internal constant PSP_SEED_AMOUNT = 10 ** 18;",
],
"execute": [
"IERC20(PSP).forceApprove(address(AaveV3Ethereum.POOL), PSP_SEED_AMOUNT);
Expand Down
11 changes: 6 additions & 5 deletions generator/features/assetListing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,12 @@ export const assetListing: FeatureModule<Listing[]> = {
build(opt, pool, cfg) {
const response: CodeArtifact = {
code: {
constants: cfg.map(
(cfg) =>
`address public constant ${cfg.assetSymbol} = ${cfg.asset};\n` +
`uint256 internal constant ${cfg.assetSymbol}_SEED_AMOUNT = 10 ** ${cfg.decimals};\n`
),
constants: cfg
.map((cfg) => [
`address public constant ${cfg.assetSymbol} = ${cfg.asset};`,
`uint256 internal constant ${cfg.assetSymbol}_SEED_AMOUNT = 10 ** ${cfg.decimals};`,
])
.flat(),
execute: cfg.map(
(cfg) =>
`IERC20(${cfg.assetSymbol}).forceApprove(address(${pool}.POOL), ${cfg.assetSymbol}_SEED_AMOUNT);
Expand Down

0 comments on commit 9d1a560

Please sign in to comment.