Skip to content

Commit

Permalink
fix comments and update yarn lock
Browse files Browse the repository at this point in the history
  • Loading branch information
josemarinas committed Jan 31, 2024
1 parent 15de92b commit c12882b
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 20 deletions.
10 changes: 5 additions & 5 deletions modules/client-common/src/context-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ export abstract class ContextCore {
);
}

for (const address of Object.values(ContractNames)) {
if (!this.overriden[address]) {
for (const contractName of Object.values(ContractNames)) {
if (!this.overriden[contractName]) {
let contractAddress: string | undefined;
// get deployment
let deployment = getNetworkDeploymentForVersion(
Expand All @@ -124,15 +124,15 @@ export abstract class ContextCore {
);
// get address from deployment
if (deployment) {
contractAddress = deployment[address]?.address;
contractAddress = deployment[contractName]?.address;
}
// custom check for ensRegistryAddress
// set the ensRegistryAddress to the network.ensAddress
if (address === ContractNames.ENS_REGISTRY && !contractAddress) {
if (contractName === ContractNames.ENS_REGISTRY && !contractAddress) {
contractAddress = this.network.ensAddress;
}
if (contractAddress) {
this.state[address] = contractAddress;
this.state[contractName] = contractAddress;
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions modules/client-common/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,14 +445,14 @@ export function getNetwork(networkish: Networkish): Network {
SupportedAliases.ETHERS_5,
aragonNw.name,
);
const nwDeployment = getNetworkDeploymentForVersion(
const networkDeployment = getNetworkDeploymentForVersion(
aragonNw.name,
SupportedVersions.V1_3_0,
);
if (!nwDeployment) {
if (!networkDeployment) {
throw new UnsupportedNetworkError(aragonNw.name);
}
const ensRegistryAddress = nwDeployment.ENSRegistry?.address;
const ensRegistryAddress = networkDeployment.ENSRegistry?.address;
network = {
name: ethers5Alias || aragonNw.name,
chainId: aragonNw.chainId,
Expand Down
2 changes: 1 addition & 1 deletion modules/client/src/addresslistVoting/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export function computeProposalStatus(
// The proposal is not executed and the start date is in the past.
// Accordingly, we check if the proposal reached enough approval
// (i.e., that the supportThreshold and minParticipation criteria are both met).
// If the approvalReached = true and the vote has ended (end date is in the past) it has succeeded.
// If the approvalReached is true and the vote has ended (end date is in the past), it has succeeded.
// This applies to normal mode and vote replacement mode.
if (proposal.approvalReached && endDate <= now) {
return ProposalStatus.SUCCEEDED;
Expand Down
6 changes: 3 additions & 3 deletions modules/client/src/multisig/internal/client/encoding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export class MultisigClientEncoding extends ClientCore
network: Networkish,
): PluginInstallItem {
const networkName = getNetwork(network).name;
const aragonNw = getNetworkNameByAlias(networkName);
if (!aragonNw) {
const aragonNetwork = getNetworkNameByAlias(networkName);
if (!aragonNetwork) {
throw new UnsupportedNetworkError(networkName);
}
const hexBytes = defaultAbiCoder.encode(
Expand All @@ -63,7 +63,7 @@ export class MultisigClientEncoding extends ClientCore
],
);
return {
id: contracts[aragonNw][SupportedVersions.V1_3_0]?.MultisigRepoProxy
id: contracts[aragonNetwork][SupportedVersions.V1_3_0]?.MultisigRepoProxy
.address || "",
data: hexToBytes(hexBytes),
};
Expand Down
4 changes: 2 additions & 2 deletions modules/client/src/multisig/internal/client/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ export class MultisigClientMethods extends ClientCore
): AsyncGenerator<PrepareInstallationStepValue> {
const network = await this.web3.getProvider().getNetwork();
const networkName = network.name;
const aragonNw = getNetworkNameByAlias(networkName);
if (!aragonNw) {
const aragonNetwork = getNetworkNameByAlias(networkName);
if (!aragonNetwork) {
throw new UnsupportedNetworkError(networkName);
}
// TODO
Expand Down
6 changes: 3 additions & 3 deletions modules/client/src/tokenVoting/internal/client/encoding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export class TokenVotingClientEncoding extends ClientCore
network: Networkish,
): PluginInstallItem {
const networkName = getNetwork(network).name;
const aragonNw = getNetworkNameByAlias(networkName);
if (!aragonNw) {
const aragonNetwork = getNetworkNameByAlias(networkName);
if (!aragonNetwork) {
throw new UnsupportedNetworkError(networkName);
}
const args = tokenVotingInitParamsToContract(params);
Expand All @@ -58,7 +58,7 @@ export class TokenVotingClientEncoding extends ClientCore
args,
);
return {
id: contracts[aragonNw][SupportedVersions.V1_3_0]?.TokenVotingRepoProxy
id: contracts[aragonNetwork][SupportedVersions.V1_3_0]?.TokenVotingRepoProxy
.address || "",
data: hexToBytes(hexBytes),
};
Expand Down
4 changes: 2 additions & 2 deletions modules/client/src/tokenVoting/internal/client/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ export class TokenVotingClientMethods extends ClientCore
): AsyncGenerator<PrepareInstallationStepValue> {
const network = await this.web3.getProvider().getNetwork();
const networkName = network.name;
const aragonNw = getNetworkNameByAlias(networkName);
if (!aragonNw) {
const aragonNetwork = getNetworkNameByAlias(networkName);
if (!aragonNetwork) {
throw new UnsupportedNetworkError(networkName);
}
yield* prepareGenericInstallation(this.web3, {
Expand Down
2 changes: 1 addition & 1 deletion modules/client/src/tokenVoting/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export function computeProposalStatus(
// The proposal is not executed and the start date is in the past.
// Accordingly, we check if the proposal reached enough approval
// (i.e., that the supportThreshold and minParticipation criteria are both met).
// If the approvalReached = true and the vote has ended (end date is in the past) it has succeeded.
// If the approvalReached is true and the vote has ended (end date is in the past), it has succeeded.
// This applies to normal mode and vote replacement mode.
if (proposal.approvalReached && endDate <= now) {
return ProposalStatus.SUCCEEDED;
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@
"@jridgewell/gen-mapping" "^0.1.0"
"@jridgewell/trace-mapping" "^0.3.9"

"@aragon/osx-commons-configs@^0.0.2":
version "0.0.2"
resolved "https://registry.yarnpkg.com/@aragon/osx-commons-configs/-/osx-commons-configs-0.0.2.tgz#8350da88c8fb93724de875589ba51eb7caa30936"
integrity sha512-RCTig39oTekBF+M5FVLY8vKlNb8CW/RPRMpZtp5llTW1AOsPwVHj8SzmVSIHDdUAcbY1f34kLYEgJJBn7AwQrQ==

"@aragon/osx-commons-configs@^0.1.0":
version "0.1.0"
resolved "https://registry.yarnpkg.com/@aragon/osx-commons-configs/-/osx-commons-configs-0.1.0.tgz#21bbc5a964eb144e30033a44cc352d35c62982f9"
integrity sha512-qTs/loihwqALBGmhZngORb+p7pjuQJY5UEd8TLNiEW/BGHEpAJPp4GeQu7GSnigRGEKWpPD5W96kfEsaPtLkuQ==
dependencies:
tslib "^2.6.2"

"@aragon/osx-ethers-v1.0.0@npm:@aragon/[email protected]", "osx-ethers-v1@npm:@aragon/[email protected]":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@aragon/osx-ethers/-/osx-ethers-1.2.1.tgz#a442048137153ed5a3ca4eff3f3927b45a5134b5"
Expand Down

0 comments on commit c12882b

Please sign in to comment.