|
| 1 | +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html |
| 2 | + |
| 3 | +exports[`feature: eModeUpdates > should properly generate files 1`] = ` |
| 4 | +{ |
| 5 | + "jsonConfig": "import {ConfigFile} from '../../generator/types'; |
| 6 | +export const config: ConfigFile = { |
| 7 | + rootOptions: { |
| 8 | + pools: ['AaveV3Ethereum'], |
| 9 | + title: 'test', |
| 10 | + shortName: 'Test', |
| 11 | + date: '20231023', |
| 12 | + author: 'test', |
| 13 | + discussion: 'test', |
| 14 | + }, |
| 15 | + poolOptions: { |
| 16 | + AaveV3Ethereum: { |
| 17 | + configs: { |
| 18 | + EMODES_UPDATE: [ |
| 19 | + { |
| 20 | + eModeCategory: 'AaveV3EthereumEModes.ETH_CORRELATED', |
| 21 | + ltv: '', |
| 22 | + liqThreshold: '50', |
| 23 | + liqBonus: '', |
| 24 | + label: '', |
| 25 | + }, |
| 26 | + ], |
| 27 | + }, |
| 28 | + cache: {blockNumber: 42}, |
| 29 | + }, |
| 30 | + }, |
| 31 | +}; |
| 32 | +", |
| 33 | + "payloads": [ |
| 34 | + { |
| 35 | + "contractName": "AaveV3Ethereum_Test_20231023", |
| 36 | + "payload": "// SPDX-License-Identifier: MIT |
| 37 | +pragma solidity ^0.8.0; |
| 38 | +
|
| 39 | +import {AaveV3EthereumEModes} from 'aave-address-book/AaveV3Ethereum.sol'; |
| 40 | +import {RiskStewardsEthereum} from '../../../../scripts/networks/RiskStewardsEthereum.s.sol'; |
| 41 | +import {EngineFlags} from 'aave-v3-origin/src/contracts/extensions/v3-config-engine/EngineFlags.sol'; |
| 42 | +import {IAaveV3ConfigEngine} from 'aave-v3-origin/src/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol'; |
| 43 | +
|
| 44 | +/** |
| 45 | + * @title test |
| 46 | + * @author test |
| 47 | + * - discussion: test |
| 48 | + * - deploy-command: make run-script contract=src/contracts/updates/20231023_AaveV3Ethereum_Test/AaveV3Ethereum_Test_20231023.sol:AaveV3Ethereum_Test_20231023 network=mainnet broadcast=false generate_diff=true skip_timelock=false |
| 49 | + */ |
| 50 | +contract AaveV3Ethereum_Test_20231023 is RiskStewardsEthereum { |
| 51 | + function name() public pure override returns (string memory) { |
| 52 | + return 'AaveV3Ethereum_Test_20231023'; |
| 53 | + } |
| 54 | +
|
| 55 | + function eModeCategoriesUpdates() |
| 56 | + public |
| 57 | + pure |
| 58 | + override |
| 59 | + returns (IAaveV3ConfigEngine.EModeCategoryUpdate[] memory) |
| 60 | + { |
| 61 | + IAaveV3ConfigEngine.EModeCategoryUpdate[] |
| 62 | + memory eModeUpdates = new IAaveV3ConfigEngine.EModeCategoryUpdate[](1); |
| 63 | +
|
| 64 | + eModeUpdates[0] = IAaveV3ConfigEngine.EModeCategoryUpdate({ |
| 65 | + eModeCategory: AaveV3EthereumEModes.ETH_CORRELATED, |
| 66 | + ltv: EngineFlags.KEEP_CURRENT, |
| 67 | + liqThreshold: 50_00, |
| 68 | + liqBonus: EngineFlags.KEEP_CURRENT, |
| 69 | + label: EngineFlags.KEEP_CURRENT_STRING |
| 70 | + }); |
| 71 | +
|
| 72 | + return eModeUpdates; |
| 73 | + } |
| 74 | +} |
| 75 | +", |
| 76 | + "pool": "AaveV3Ethereum", |
| 77 | + }, |
| 78 | + ], |
| 79 | +} |
| 80 | +`; |
| 81 | + |
| 82 | +exports[`feature: eModeUpdates > should return reasonable code 1`] = ` |
| 83 | +{ |
| 84 | + "code": { |
| 85 | + "fn": [ |
| 86 | + "function eModeCategoriesUpdates() public pure override returns (IAaveV3ConfigEngine.EModeCategoryUpdate[] memory) { |
| 87 | + IAaveV3ConfigEngine.EModeCategoryUpdate[] memory eModeUpdates = new IAaveV3ConfigEngine.EModeCategoryUpdate[](1); |
| 88 | +
|
| 89 | + eModeUpdates[0] = IAaveV3ConfigEngine.EModeCategoryUpdate({ |
| 90 | + eModeCategory: AaveV3EthereumEModes.ETH_CORRELATED, |
| 91 | + ltv: EngineFlags.KEEP_CURRENT, |
| 92 | + liqThreshold: 50_00, |
| 93 | + liqBonus: EngineFlags.KEEP_CURRENT, |
| 94 | + label: EngineFlags.KEEP_CURRENT_STRING |
| 95 | + }); |
| 96 | +
|
| 97 | + return eModeUpdates; |
| 98 | + }", |
| 99 | + ], |
| 100 | + }, |
| 101 | +} |
| 102 | +`; |
0 commit comments