Skip to content

Commit

Permalink
Change getTotalVotingSupplyAt function name.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnaviask committed Jun 21, 2021
1 parent 2b36b3e commit 630f028
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 42 deletions.
9 changes: 2 additions & 7 deletions client/scripts/controllers/chain/ethereum/aave/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,9 @@ export default class AaveApi extends ContractApi<AaveGovernanceV2> {
// fetch token from strategy (if possible)
let tokenAddress;
try {
tokenAddress = await this.Strategy.AAVE();
tokenAddress = await this.Strategy.DYDX_TOKEN();
} catch (e) {
// dydx-ropsten token
try {
tokenAddress = await this.Strategy['DYDX_TOKEN()']();
} catch (e) {
console.error(`Failed to fetch token contract: ${e.message}`);
}
console.error(`Failed to fetch token contract: ${e.message}`);
}
if (tokenAddress) {
this._Token = AaveTokenV2__factory.connect(tokenAddress, this.Contract.provider);
Expand Down
14 changes: 7 additions & 7 deletions client/scripts/controllers/chain/ethereum/aave/proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,15 @@ export default class AaveProposal extends Proposal<
}

try {
const totalVotingSupplyAtStart = await this._Gov.api.Strategy.getTotalVotingSupplyAt(this.data.startBlock);
const totalVotingSupplyAtStart = await this._Gov.api.Strategy.getVotingSupplyAt(this.data.startBlock);
this._votingSupplyAtStart = new BN(totalVotingSupplyAtStart.toString());
} catch (e2) {
console.error(
'Failed to fetch total voting supply at proposal start block, using hardcoded dydx value.'
);
this._votingSupplyAtStart = Web3.utils.toWei(new BN(1_000_000_000), 'ether')
} catch (e) {
console.error(`Failed to fetch total voting supply: ${e.message}`);
// this._votingSupplyAtStart = Web3.utils.toWei(new BN(1_000_000_000), 'ether')
this._initialized = true;
return;
}
console.log(this._Executor);

this._minVotingPowerNeeded = this._votingSupplyAtStart
.mul(this._Executor.minimumQuorum)
.divn(10000);
Expand Down
26 changes: 13 additions & 13 deletions shared/eth/types/GovernanceStrategy.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface GovernanceStrategyInterface extends ethers.utils.Interface {
"STK_AAVE()": FunctionFragment;
"getPropositionPowerAt(address,uint256)": FunctionFragment;
"getTotalPropositionSupplyAt(uint256)": FunctionFragment;
"getTotalVotingSupplyAt(uint256)": FunctionFragment;
"getVotingSupplyAt(uint256)": FunctionFragment;
"getVotingPowerAt(address,uint256)": FunctionFragment;
};

Expand All @@ -39,7 +39,7 @@ interface GovernanceStrategyInterface extends ethers.utils.Interface {
values: [BigNumberish]
): string;
encodeFunctionData(
functionFragment: "getTotalVotingSupplyAt",
functionFragment: "getVotingSupplyAt",
values: [BigNumberish]
): string;
encodeFunctionData(
Expand All @@ -58,7 +58,7 @@ interface GovernanceStrategyInterface extends ethers.utils.Interface {
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getTotalVotingSupplyAt",
functionFragment: "getVotingSupplyAt",
data: BytesLike
): Result;
decodeFunctionResult(
Expand Down Expand Up @@ -143,12 +143,12 @@ export class GovernanceStrategy extends Contract {
overrides?: CallOverrides
): Promise<[BigNumber]>;

getTotalVotingSupplyAt(
getVotingSupplyAt(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<[BigNumber]>;

"getTotalVotingSupplyAt(uint256)"(
"getVotingSupplyAt(uint256)"(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<[BigNumber]>;
Expand Down Expand Up @@ -196,12 +196,12 @@ export class GovernanceStrategy extends Contract {
overrides?: CallOverrides
): Promise<BigNumber>;

getTotalVotingSupplyAt(
getVotingSupplyAt(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;

"getTotalVotingSupplyAt(uint256)"(
"getVotingSupplyAt(uint256)"(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;
Expand Down Expand Up @@ -249,12 +249,12 @@ export class GovernanceStrategy extends Contract {
overrides?: CallOverrides
): Promise<BigNumber>;

getTotalVotingSupplyAt(
getVotingSupplyAt(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;

"getTotalVotingSupplyAt(uint256)"(
"getVotingSupplyAt(uint256)"(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;
Expand Down Expand Up @@ -305,12 +305,12 @@ export class GovernanceStrategy extends Contract {
overrides?: CallOverrides
): Promise<BigNumber>;

getTotalVotingSupplyAt(
getVotingSupplyAt(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;

"getTotalVotingSupplyAt(uint256)"(
"getVotingSupplyAt(uint256)"(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;
Expand Down Expand Up @@ -359,12 +359,12 @@ export class GovernanceStrategy extends Contract {
overrides?: CallOverrides
): Promise<PopulatedTransaction>;

getTotalVotingSupplyAt(
getVotingSupplyAt(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;

"getTotalVotingSupplyAt(uint256)"(
"getVotingSupplyAt(uint256)"(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
Expand Down
26 changes: 13 additions & 13 deletions shared/eth/types/IGovernanceStrategy.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface IGovernanceStrategyInterface extends ethers.utils.Interface {
functions: {
"getPropositionPowerAt(address,uint256)": FunctionFragment;
"getTotalPropositionSupplyAt(uint256)": FunctionFragment;
"getTotalVotingSupplyAt(uint256)": FunctionFragment;
"getVotingSupplyAt(uint256)": FunctionFragment;
"getVotingPowerAt(address,uint256)": FunctionFragment;
};

Expand All @@ -35,7 +35,7 @@ interface IGovernanceStrategyInterface extends ethers.utils.Interface {
values: [BigNumberish]
): string;
encodeFunctionData(
functionFragment: "getTotalVotingSupplyAt",
functionFragment: "getVotingSupplyAt",
values: [BigNumberish]
): string;
encodeFunctionData(
Expand All @@ -52,7 +52,7 @@ interface IGovernanceStrategyInterface extends ethers.utils.Interface {
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getTotalVotingSupplyAt",
functionFragment: "getVotingSupplyAt",
data: BytesLike
): Result;
decodeFunctionResult(
Expand Down Expand Up @@ -129,12 +129,12 @@ export class IGovernanceStrategy extends Contract {
overrides?: CallOverrides
): Promise<[BigNumber]>;

getTotalVotingSupplyAt(
getVotingSupplyAt(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<[BigNumber]>;

"getTotalVotingSupplyAt(uint256)"(
"getVotingSupplyAt(uint256)"(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<[BigNumber]>;
Expand Down Expand Up @@ -174,12 +174,12 @@ export class IGovernanceStrategy extends Contract {
overrides?: CallOverrides
): Promise<BigNumber>;

getTotalVotingSupplyAt(
getVotingSupplyAt(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;

"getTotalVotingSupplyAt(uint256)"(
"getVotingSupplyAt(uint256)"(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;
Expand Down Expand Up @@ -219,12 +219,12 @@ export class IGovernanceStrategy extends Contract {
overrides?: CallOverrides
): Promise<BigNumber>;

getTotalVotingSupplyAt(
getVotingSupplyAt(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;

"getTotalVotingSupplyAt(uint256)"(
"getVotingSupplyAt(uint256)"(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;
Expand Down Expand Up @@ -267,12 +267,12 @@ export class IGovernanceStrategy extends Contract {
overrides?: CallOverrides
): Promise<BigNumber>;

getTotalVotingSupplyAt(
getVotingSupplyAt(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;

"getTotalVotingSupplyAt(uint256)"(
"getVotingSupplyAt(uint256)"(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;
Expand Down Expand Up @@ -313,12 +313,12 @@ export class IGovernanceStrategy extends Contract {
overrides?: CallOverrides
): Promise<PopulatedTransaction>;

getTotalVotingSupplyAt(
getVotingSupplyAt(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;

"getTotalVotingSupplyAt(uint256)"(
"getVotingSupplyAt(uint256)"(
blockNumber: BigNumberish,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
Expand Down
2 changes: 1 addition & 1 deletion shared/eth/types/factories/GovernanceStrategy__factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const _abi = [
type: "uint256",
},
],
name: "getTotalVotingSupplyAt",
name: "getVotingSupplyAt",
outputs: [
{
internalType: "uint256",
Expand Down
2 changes: 1 addition & 1 deletion shared/eth/types/factories/IGovernanceStrategy__factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const _abi = [
type: "uint256",
},
],
name: "getTotalVotingSupplyAt",
name: "getVotingSupplyAt",
outputs: [
{
internalType: "uint256",
Expand Down

0 comments on commit 630f028

Please sign in to comment.