Skip to content

Commit

Permalink
fix: add output
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra committed Sep 12, 2023
1 parent 88d5f20 commit 181d303
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions src/commands/governance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { simulateProposal } from '../govv3/simulate';
import { GovernanceV3Goerli, IVotingMachineWithProofs_ABI, IVotingPortal_ABI } from '@bgd-labs/aave-address-book';
import { HUMAN_READABLE_STATE, ProposalState, getGovernance } from '../govv3/governance';
import { RPC_MAP, goerliClient } from '../utils/rpcClients';
import { logError, logInfo } from '../utils/logger';
import { logError, logInfo, logSuccess } from '../utils/logger';
import {
Hex,
PublicClient,
Expand Down Expand Up @@ -149,10 +149,6 @@ export function addCommand(program: Command) {

const proposal = await governance.governanceContract.read.getProposal([proposalId]);

if (proposal.state !== ProposalState.Active) {
// throw new Error('can only vote on active proposals');
}

if ((voteFor && voteAgainst) || (!voteFor && !voteAgainst)) {
throw new Error('you must either vote --for, or --against');
}
Expand Down Expand Up @@ -189,16 +185,10 @@ export function addCommand(program: Command) {
.flat(),
],
});
console.log(
proofs
.map(({ proof, slots }) => {
return slots.map((slot, ix) => ({
underlyingAsset: proof.address,
slot,
proof: getAccountRPL(proof.storageProof[ix].proof),
}));
})
.flat()
);
logInfo('Voting', `Encoded data to be submitted on ${chainId}:${machine}`);
logSuccess('Encoded data', encodedData);
if (proposal.state !== ProposalState.Active) {
logError('ImpossibleToVote', 'You can only vote on active proposals');
}
});
}

0 comments on commit 181d303

Please sign in to comment.