Skip to content

Commit 0c85a18

Browse files
authored
fix: continue with deprecation (#216)
1 parent 28b3276 commit 0c85a18

18 files changed

+752
-650
lines changed

bun.lock

Lines changed: 724 additions & 0 deletions
Large diffs are not rendered by default.

bun.lockb

-138 KB
Binary file not shown.

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,20 @@
5757
"access": "public"
5858
},
5959
"dependencies": {
60-
"@bgd-labs/aave-address-book": "^4.21.0",
60+
"@bgd-labs/aave-address-book": "^4.28.1",
6161
"@bgd-labs/aave-v3-governance-cache": "^1.0.11",
62-
"@bgd-labs/js-utils": "^1.4.8",
63-
"@bgd-labs/rpc-env": "^2.3.2",
6462
"@bgd-labs/toolbox": "^0.0.40",
6563
"@commander-js/extra-typings": "^12.1.0",
6664
"@inquirer/prompts": "^7.1.0",
67-
"blockstore-core": "^5.0.2",
65+
"blockstore-core": "^5.0.4",
66+
"bs58": "^6.0.0",
6867
"chalk": "^4.1.2",
6968
"commander": "^12.1.0",
7069
"deepmerge": "^4.3.1",
7170
"dotenv": "^16.4.1",
7271
"find-object-paths": "^1.1.0",
7372
"gray-matter": "^4.0.3",
74-
"ipfs-unixfs-importer": "^15.3.1",
73+
"ipfs-unixfs-importer": "^15.4.0",
7574
"json-bigint": "^1.0.0",
7675
"viem": "^2.22.21",
7776
"zod": "^3.23.8"

src/commands/diffSnaphots.ts

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,10 @@
11
import fs from 'node:fs';
22
import path from 'node:path';
3-
import {compareStorageLayouts} from '@bgd-labs/js-utils';
43
import type {Command} from '@commander-js/extra-typings';
54
import {adiDiffReports} from '../reports/adi-diff-reports';
6-
import {diffReports} from '../reports/diff-reports';
75
import {readJsonFile, readJsonString} from '../utils/json';
86

97
export function addCommand(program: Command) {
10-
program
11-
.command('diff-snapshots')
12-
.description('generate a snapshot diff report')
13-
.argument('<from>')
14-
.argument('<to>')
15-
.option('-o, --out <string>', 'output path')
16-
.option('--stringMode', 'expects input to be a string, not paths')
17-
.action(async (_from, _to, options) => {
18-
const from = options.stringMode ? readJsonString(_from) : readJsonFile(_from);
19-
const to = options.stringMode ? readJsonString(_to) : readJsonFile(_to);
20-
const content = await diffReports(from, to);
21-
if (options.out) {
22-
fs.mkdirSync(path.dirname(options.out), {recursive: true});
23-
fs.writeFileSync(options.out, content);
24-
} else {
25-
console.log(content);
26-
}
27-
});
28-
298
program
309
.command('adi-diff-snapshots')
3110
.description('generate a aDI snapshot diff report')
@@ -44,22 +23,4 @@ export function addCommand(program: Command) {
4423
console.log(content);
4524
}
4625
});
47-
48-
program
49-
.command('diff-storage')
50-
.description('generate a storage diff')
51-
.argument('<from>')
52-
.argument('<to>')
53-
.option('-o, --out <string>', 'output path')
54-
.action(async (_from, _to, options) => {
55-
const from = readJsonFile(_from);
56-
const to = readJsonFile(_to);
57-
const content = await compareStorageLayouts(from, to);
58-
if (options.out) {
59-
fs.mkdirSync(path.dirname(options.out), {recursive: true});
60-
fs.writeFileSync(options.out, content);
61-
} else {
62-
console.log(content);
63-
}
64-
});
6526
}

src/commands/governance.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import type {Command} from '@commander-js/extra-typings';
77
import {confirm, input, select} from '@inquirer/prompts';
88
import {type Hex, encodeAbiParameters, encodeFunctionData, getContract} from 'viem';
99
import {HUMAN_READABLE_STATE, getGovernance} from '../govv3/governance';
10-
import {getPayloadsController} from '../govv3/payloadsController';
1110
import {getAccountRPL, getBlockRLP} from '../govv3/proofs';
12-
import {findPayloadsController} from '../govv3/utils/checkAddress';
1311
import {toAddressLink, toTxLink} from '../govv3/utils/markdownUtils';
1412
import {DEFAULT_GOVERNANCE, DEFAULT_GOVERNANCE_CLIENT, FORMAT} from '../utils/constants';
1513
import {logError, logInfo, logSuccess} from '../utils/logger';
@@ -20,7 +18,7 @@ import {fileSystemStorageAdapter} from '@bgd-labs/aave-v3-governance-cache/fileS
2018
const localCacheAdapter = customStorageProvider(fileSystemStorageAdapter);
2119

2220
import {refreshCache} from '@bgd-labs/aave-v3-governance-cache/refreshCache';
23-
import {getClient} from '../utils/getClient';
21+
import {ChainList} from '@bgd-labs/toolbox';
2422

2523
enum DialogOptions {
2624
DETAILS = 0,
@@ -148,7 +146,7 @@ export function addCommand(program: Command) {
148146
logInfo('VotingPortal', cache.proposal.votingPortal);
149147
cache.proposal.payloads.map((payload, ix) => {
150148
logInfo(`Payload.${ix}.accessLevel`, payload.accessLevel);
151-
logInfo(`Payload.${ix}.chain`, getClient(Number(payload.chain)).chain!.name);
149+
logInfo(`Payload.${ix}.chain`, ChainList[payload.chain as keyof typeof ChainList].name);
152150
logInfo(`Payload.${ix}.payloadId`, payload.payloadId);
153151
logInfo(`Payload.${ix}.payloadsController`, payload.payloadsController);
154152
});

src/govv3/utils/checkAddress.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {GovernanceV3Ethereum} from '@bgd-labs/aave-address-book';
2-
import {ChainId} from '@bgd-labs/rpc-env';
32
import {describe, expect, it} from 'vitest';
43
import {isKnownAddress} from './checkAddress';
4+
import {ChainId} from '@bgd-labs/toolbox';
55

66
describe('isKnownAddress', () => {
77
it('should return path on correct network', () => {

src/ipfs/getCachedProposalMetaData.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/reports/__snapshots__/diff-report.spec.ts.snap

Lines changed: 0 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -296,150 +296,6 @@ exports[`report > should generate a well formatted report 1`] = `
296296
\`\`\`"
297297
`;
298298

299-
exports[`report > should generate a well formatted report for 3.0 to 3.1 1`] = `
300-
"## Reserve changes
301-
302-
### Reserve altered
303-
304-
#### WBTC (0x3C8Ca53ee5661D29d3d3C0732689a4b86947EAF0)
305-
306-
| description | value before | value after |
307-
| --- | --- | --- |
308-
| address | null | 0xF9514C867b37D36a5affB003582b1818dA3870eb |
309-
| baseVariableBorrowRate | null | 0 |
310-
| maxVariableBorrowRate | null | 640000000000000000000000000 |
311-
| optimalUsageRatio | null | 450000000000000000000000000 |
312-
| variableRateSlope1 | null | 40000000000000000000000000 |
313-
| variableRateSlope2 | null | 600000000000000000000000000 |
314-
315-
316-
#### WETH (0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f)
317-
318-
| description | value before | value after |
319-
| --- | --- | --- |
320-
| address | null | 0xF9514C867b37D36a5affB003582b1818dA3870eb |
321-
| baseVariableBorrowRate | null | 0 |
322-
| maxVariableBorrowRate | null | 640000000000000000000000000 |
323-
| optimalUsageRatio | null | 450000000000000000000000000 |
324-
| variableRateSlope1 | null | 40000000000000000000000000 |
325-
| variableRateSlope2 | null | 600000000000000000000000000 |
326-
327-
328-
#### USDX (0xffD4505B3452Dc22f8473616d50503bA9E1710Ac)
329-
330-
| description | value before | value after |
331-
| --- | --- | --- |
332-
| ltv | 82.5 % [8250] | 62 % [6200] |
333-
| liquidationThreshold | 86 % [8600] | 90 % [9000] |
334-
| liquidationBonus | 5 % | 11 % |
335-
| address | null | 0xF9514C867b37D36a5affB003582b1818dA3870eb |
336-
| baseVariableBorrowRate | null | 0 |
337-
| maxVariableBorrowRate | null | 640000000000000000000000000 |
338-
| optimalUsageRatio | null | 450000000000000000000000000 |
339-
| variableRateSlope1 | null | 40000000000000000000000000 |
340-
| variableRateSlope2 | null | 600000000000000000000000000 |
341-
342-
343-
## Raw diff
344-
345-
\`\`\`json
346-
{
347-
"reserves": {
348-
"0x3C8Ca53ee5661D29d3d3C0732689a4b86947EAF0": {
349-
"address": {
350-
"from": null,
351-
"to": "0xF9514C867b37D36a5affB003582b1818dA3870eb"
352-
},
353-
"baseVariableBorrowRate": {
354-
"from": null,
355-
"to": "0"
356-
},
357-
"maxVariableBorrowRate": {
358-
"from": null,
359-
"to": "640000000000000000000000000"
360-
},
361-
"optimalUsageRatio": {
362-
"from": null,
363-
"to": "450000000000000000000000000"
364-
},
365-
"variableRateSlope1": {
366-
"from": null,
367-
"to": "40000000000000000000000000"
368-
},
369-
"variableRateSlope2": {
370-
"from": null,
371-
"to": "600000000000000000000000000"
372-
}
373-
},
374-
"0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f": {
375-
"address": {
376-
"from": null,
377-
"to": "0xF9514C867b37D36a5affB003582b1818dA3870eb"
378-
},
379-
"baseVariableBorrowRate": {
380-
"from": null,
381-
"to": "0"
382-
},
383-
"maxVariableBorrowRate": {
384-
"from": null,
385-
"to": "640000000000000000000000000"
386-
},
387-
"optimalUsageRatio": {
388-
"from": null,
389-
"to": "450000000000000000000000000"
390-
},
391-
"variableRateSlope1": {
392-
"from": null,
393-
"to": "40000000000000000000000000"
394-
},
395-
"variableRateSlope2": {
396-
"from": null,
397-
"to": "600000000000000000000000000"
398-
}
399-
},
400-
"0xffD4505B3452Dc22f8473616d50503bA9E1710Ac": {
401-
"liquidationBonus": {
402-
"from": 10500,
403-
"to": 11100
404-
},
405-
"liquidationThreshold": {
406-
"from": 8600,
407-
"to": 9000
408-
},
409-
"ltv": {
410-
"from": 8250,
411-
"to": 6200
412-
},
413-
"address": {
414-
"from": null,
415-
"to": "0xF9514C867b37D36a5affB003582b1818dA3870eb"
416-
},
417-
"baseVariableBorrowRate": {
418-
"from": null,
419-
"to": "0"
420-
},
421-
"maxVariableBorrowRate": {
422-
"from": null,
423-
"to": "640000000000000000000000000"
424-
},
425-
"optimalUsageRatio": {
426-
"from": null,
427-
"to": "450000000000000000000000000"
428-
},
429-
"variableRateSlope1": {
430-
"from": null,
431-
"to": "40000000000000000000000000"
432-
},
433-
"variableRateSlope2": {
434-
"from": null,
435-
"to": "600000000000000000000000000"
436-
}
437-
}
438-
}
439-
}
440-
\`\`\`"
441-
`;
442-
443299
exports[`report > should generate a well formatted report for 3.1 1`] = `
444300
"## Reserve changes
445301

src/reports/__snapshots__/reserve.spec.ts.snap

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -50,47 +50,6 @@ exports[`reserve > renderReserve > should properly render new reserve 1`] = `
5050
"
5151
`;
5252

53-
exports[`reserve > renderReserve > should properly render new reserve with local chain id 1`] = `
54-
"#### WBTC (0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f)
55-
56-
| description | value |
57-
| --- | --- |
58-
| decimals | 8 |
59-
| isActive | true |
60-
| isFrozen | false |
61-
| supplyCap | 2,100 WBTC |
62-
| borrowCap | 1,115 WBTC |
63-
| debtCeiling | 1,000 $ [100000] |
64-
| isSiloed | false |
65-
| isFlashloanable | false |
66-
| eModeCategory | 0 |
67-
| oracle | 0x6ce185860a4963106506C203335A2910413708e9 |
68-
| oracleDecimals | 8 |
69-
| oracleDescription | BTC / USD |
70-
| oracleName | BTC / USD |
71-
| oracleLatestAnswer | 22519.04551524 |
72-
| usageAsCollateralEnabled | true |
73-
| ltv | 70 % [7000] |
74-
| liquidationThreshold | 75.55 % [7555] |
75-
| liquidationBonus | 10 % |
76-
| liquidationProtocolFee | 10 % [1000] |
77-
| reserveFactor | 20 % [2000] |
78-
| aToken | 0x078f358208685046a11C85e8ad32895DED33A249 |
79-
| aTokenImpl | 0xa5ba6E5EC19a1Bf23C857991c857dB62b2Aa187B |
80-
| variableDebtToken | 0x92b42c66840C7AD907b4BF74879FF3eF7c529473 |
81-
| variableDebtTokenImpl | 0x81387c40EB75acB02757C1Ae55D5936E78c9dEd3 |
82-
| stableDebtToken | 0x633b207Dd676331c413D4C013a6294B0FE47cD0e |
83-
| stableDebtTokenImpl | 0x52A1CeB68Ee6b7B5D13E0376A1E0E4423A8cE26e |
84-
| borrowingEnabled | true |
85-
| stableBorrowRateEnabled | false |
86-
| isBorrowableInIsolation | false |
87-
| interestRateStrategy | 0x9b34E3e183c9b0d1a08fF57a8fb59c821616295f |
88-
| aTokenUnderlyingBalance | 0 WBTC [0] |
89-
| virtualAccountingActive | true |
90-
| virtualBalance | 0 WBTC [0] |
91-
"
92-
`;
93-
9453
exports[`reserve > renderReserve > should render decimals 1`] = `
9554
"#### WBTC ([0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f](https://etherscan.io/address/0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f))
9655

src/reports/diff-report.spec.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,6 @@ describe('report', () => {
1313
},
1414
{timeout: 30000},
1515
);
16-
it(
17-
'should generate a well formatted report for 3.0 to 3.1',
18-
async () => {
19-
const from = readJsonFile('/src/reports/mocks/pre3-1.json');
20-
const to = readJsonFile('/src/reports/mocks/post3-1.json');
21-
const content = await diffReports(from, to);
22-
expect(content).toMatchSnapshot();
23-
},
24-
{timeout: 30000},
25-
);
2616
it(
2717
'should generate a well formatted report for 3.1',
2818
async () => {

0 commit comments

Comments
 (0)