Skip to content

Commit

Permalink
fix: require gov address
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra committed Aug 22, 2023
1 parent d519760 commit cc7e313
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/commands/simulate-proposal-v3.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { simulateProposal } from '../simulate/govv3/simulate';
import { AaveV3Sepolia } from '@bgd-labs/aave-address-book';

export const command = 'simulate-proposal-v3 [proposalId]';

Expand All @@ -7,6 +8,6 @@ export const describe = 'simulates a aave v3 governance proposal';
export const handler = async function (argv) {
if (!argv.proposalId) throw new Error('proposalId is required');
const proposalId = BigInt(argv.proposalId);
const result = await simulateProposal(proposalId);
const result = await simulateProposal(AaveV3Sepolia.GOVERNANCE, proposalId);
// console.log(result);
};
6 changes: 3 additions & 3 deletions src/simulate/govv3/simulate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AaveV3Sepolia } from '@bgd-labs/aave-address-book';
import { logError, logInfo, logSuccess } from '../../utils/logger';
import { TenderlySimulationResponse } from '../../utils/tenderlyClient';
import { getGovernance } from './governance';
import { createPublicClient, http } from 'viem';
import { Hex, createPublicClient, http } from 'viem';
import { sepolia, polygonMumbai, bscTestnet, avalancheFuji } from 'viem/chains';
import { PayloadsController, getPayloadsController } from './payloadsController';

Expand All @@ -25,10 +25,10 @@ const CHAIN_ID_CLIENT_MAP = {
},
} as const;

export async function simulateProposal(proposalId: bigint) {
export async function simulateProposal(governanceAddress: Hex, proposalId: bigint) {
logInfo('General', `Running simulation for ${proposalId}`);
const governance = getGovernance(
AaveV3Sepolia.GOVERNANCE,
governanceAddress,
createPublicClient({ chain: sepolia, transport: http(process.env.RPC_SEPOLIA) }),
3962575n
);
Expand Down

0 comments on commit cc7e313

Please sign in to comment.