Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: properly render virtual balance fields #148

Merged
merged 2 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .assets/25f9cbdfc80fe1053a3498957e9ebcc43204ca2e.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/c95444425ee9452f419610e3fd51b1682c09f4e7.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@
"access": "public"
},
"dependencies": {
"@bgd-labs/aave-address-book": "^2.25.1",
"@bgd-labs/aave-v3-governance-cache": "^0.0.13",
"@bgd-labs/js-utils": "^1.3.0",
"@bgd-labs/aave-address-book": "^3.0.0",
"@bgd-labs/aave-v3-governance-cache": "^1.0.6",
"@bgd-labs/js-utils": "^1.4.2",
"@commander-js/extra-typings": "^11.1.0",
"@inquirer/prompts": "^3.3.2",
"chalk": "^4.1.2",
"commander": "^11.1.0",
"deepmerge": "^4.3.1",
"dotenv": "^16.4.1",
"find-object-paths": "^1.0.2",
"find-object-paths": "^1.1.0",
"gray-matter": "^4.0.3",
"ipfs-only-hash": "^4.0.0",
"json-bigint": "^1.0.0",
"object-hash": "^3.0.0",
"viem": "^2.9.20",
"zod": "^3.22.4"
"viem": "^2.17.11",
"zod": "^3.23.8"
}
}
6 changes: 5 additions & 1 deletion src/commands/governance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ import {getCachedIpfs} from '../ipfs/getCachedProposalMetaData';
import {DEFAULT_GOVERNANCE, DEFAULT_GOVERNANCE_CLIENT, FORMAT} from '../utils/constants';
import {logError, logInfo, logSuccess} from '../utils/logger';
import {getBlock} from 'viem/actions';
import {localCacheAdapter} from '@bgd-labs/aave-v3-governance-cache/localCache';
import {customStorageProvider} from '@bgd-labs/aave-v3-governance-cache/customStorageProvider';
import {fileSystemStorageAdapter} from '@bgd-labs/aave-v3-governance-cache/fileSystemStorageAdapter';

const localCacheAdapter = customStorageProvider(fileSystemStorageAdapter);

import {refreshCache} from '@bgd-labs/aave-v3-governance-cache/refreshCache';

enum DialogOptions {
Expand Down
28 changes: 14 additions & 14 deletions src/govv3/__snapshots__/generatePayloadReport.spec.ts.snap

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/govv3/checks/__snapshots__/state.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Dai (Dai) at \`0x6B175474E89094C44Da98b954EedeAC495271d0F\`[:ghost:](https://git
+ 115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457.5840 [115792089237316195423570985008687907853269984665640564039457584007913129639935, 18 decimals]
\`\`\`

InitializableImmutableAdminUpgradeabilityProxy at \`0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.POOL") with implementation LendingPool at \`0x085E34722e04567Df9E6d2c32e82fd74f3342e79\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.POOL_IMPL")
InitializableImmutableAdminUpgradeabilityProxy at \`0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.POOL") with implementation LendingPool at \`0x085E34722e04567Df9E6d2c32e82fd74f3342e79\`
\`\`\`diff
@@ \`_reserves\` key \`0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 (symbol: USDC).liquidityIndex\` @@
- 1.1259 [1125972900043692179606694722, 27 decimals]
Expand Down Expand Up @@ -180,7 +180,7 @@ exports[`state check > should correctly render state diff for config change 1`]
"errors": [],
"info": [
"
InitializableImmutableAdminUpgradeabilityProxy at \`0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.POOL") with implementation LendingPool at \`0x085E34722e04567Df9E6d2c32e82fd74f3342e79\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.POOL_IMPL")
InitializableImmutableAdminUpgradeabilityProxy at \`0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.POOL") with implementation LendingPool at \`0x085E34722e04567Df9E6d2c32e82fd74f3342e79\`
\`\`\`diff
@@ \`_reserves\` key \`0x0000000000085d4780b73119b644ae5ecd22b376 (symbol: TUSD).configuration.data\` @@
- 184283194582935181459456
Expand Down
4 changes: 3 additions & 1 deletion src/govv3/generatePayloadReport.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import {STREAM_PAYLOAD} from './mocks/streamPayload';
import {findPayloadsController} from './utils/checkAddress';
import {getPayloadsController} from './payloadsController';
import {Address} from 'viem';
import {localCacheAdapter} from '@bgd-labs/aave-v3-governance-cache/localCache';
import {customStorageProvider} from '@bgd-labs/aave-v3-governance-cache/customStorageProvider';
import {fileSystemStorageAdapter} from '@bgd-labs/aave-v3-governance-cache/fileSystemStorageAdapter';

const localCacheAdapter = customStorageProvider(fileSystemStorageAdapter);
/**
* Tenderly simulation results are insanely huge, so we're removing some stuff we don't need
* @param mockData
Expand Down
4 changes: 3 additions & 1 deletion src/govv3/simulate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import {generateReport} from './generatePayloadReport';
import {generateProposalReport} from './generateProposalReport';
import {getGovernance} from './governance';
import {getPayloadsController} from './payloadsController';
import {localCacheAdapter} from '@bgd-labs/aave-v3-governance-cache/localCache';
import {refreshCache} from '@bgd-labs/aave-v3-governance-cache/refreshCache';
import {GetPayloadReturnType} from '@bgd-labs/aave-v3-governance-cache';
import {customStorageProvider} from '@bgd-labs/aave-v3-governance-cache/customStorageProvider';
import {fileSystemStorageAdapter} from '@bgd-labs/aave-v3-governance-cache/fileSystemStorageAdapter';

const localCacheAdapter = customStorageProvider(fileSystemStorageAdapter);
/**
* Reference implementation, unused
* @param governanceAddress
Expand Down
30 changes: 30 additions & 0 deletions src/reports/__snapshots__/adi-diff-report.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`adi report > should generate a well formatted adi report 1`] = `
"## Raw diff

\`\`\`json
{
"forwarderAdaptersByChain": {
"1": {
"destination_3": {
"from": "0xb13712De579E1f9943502FFCf72eab6ec348cF79",
"to": "0x1562F1b2487F892BBA8Ef325aF054Fd157510a71"
},
"origin_3": {
"from": "0xb13712De579E1f9943502FFCf72eab6ec348cF79",
"to": "0x853649f897383f89d8441346Cf26a9ed02720B02"
}
}
},
"receiverAdaptersByChain": {
"1": {
"receiver_3": {
"from": "0xb13712De579E1f9943502FFCf72eab6ec348cF79",
"to": "0x853649f897383f89d8441346Cf26a9ed02720B02"
}
}
}
}
\`\`\`"
`;
Loading
Loading