Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
josemarinas committed Feb 8, 2024
1 parent c421393 commit f2b6704
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 14 deletions.
7 changes: 4 additions & 3 deletions modules/client-common/src/context-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ import {

const DEFAULT_GAS_FEE_ESTIMATION_FACTOR = 0.625;
const supportedProtocols = ["https:"];
const contractNames = Object.values(ContractNames);
if (typeof process !== "undefined" && process?.env?.TESTING) {
supportedProtocols.push("http:");
}

export abstract class ContextCore {
protected state: ContextState = {} as ContextState;

protected overriden: OverriddenState = Object.values(ContractNames).reduce(
protected overriden: OverriddenState = contractNames.reduce(
(acc, key) => ({ ...acc, [key]: false }),
{ ENSRegistry: false } as OverriddenState,
);
Expand Down Expand Up @@ -80,7 +81,7 @@ export abstract class ContextCore {
this.overriden.ipfsNodes = true;
}
// Set all the available addresses
for (const address of Object.values(ContractNames)) {
for (const address of contractNames) {
if (contextParams[address]) {
this.state[address] = contextParams[address]!;
this.overriden[address] = true;
Expand Down Expand Up @@ -115,7 +116,7 @@ export abstract class ContextCore {
);
}
// set contract addresses
for (const contractName of Object.values(ContractNames)) {
for (const contractName of contractNames) {
if (!this.overriden[contractName]) {
let contractAddress: string | undefined;
// get deployment
Expand Down
5 changes: 0 additions & 5 deletions modules/client-common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,6 @@ export type ApplyUpdateParams = ApplyUpdateParamsBase & {
export type DecodedApplyUpdateParams = ApplyUpdateParamsBase & {
helpersHash: string;
};
export enum SupportedVersion {
V1_0_0 = "1.0.0",
V1_3_0 = "1.3.0",
LATEST = "1.3.0",
}
export type IsMemberParams = {
address: string;
pluginAddress: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ const metadataUri: string = await multisigClient.methods.pinMetadata(
const proposalParams: CreateMultisigProposalParams = {
pluginAddress: "0x1234567890123456789012345678901234567890",
metadataUri,
// Boolean array indicating the actions that can and cannot fail
// when the proposal is executed.
failSafeActions: [],
actions: [], // optional - if left as an empty array, no action will be set for the proposal. the action needs to be encoded and will be executed once a proposal passes.
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export class AddresslistVotingClientEncoding 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 @@ -58,7 +58,7 @@ export class AddresslistVotingClientEncoding extends ClientCore
);

return {
id: contracts[aragonNw][SupportedVersions.V1_3_0]
id: contracts[aragonNetwork][SupportedVersions.V1_3_0]
?.AddresslistVotingRepoProxy.address || "",
data: hexToBytes(hexBytes),
};
Expand Down
2 changes: 2 additions & 0 deletions modules/client/src/multisig/internal/client/encoding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ export class MultisigClientEncoding extends ClientCore
],
);
return {
// this case will return "" when the version 1.3.0 of the contracts is not deployed
// in the specified network
id: contracts[aragonNetwork][SupportedVersions.V1_3_0]?.MultisigRepoProxy
.address || "",
data: hexToBytes(hexBytes),
Expand Down
2 changes: 0 additions & 2 deletions modules/client/test/integration/client/methods.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,12 @@ describe("Client", () => {
deployment.pluginSetupProcessor.address;
contextParamsLocalChain.MultisigRepoProxy =
deployment.multisigRepo.address;
contextParamsLocalChain.AdminRepoProxy = "";
contextParamsLocalChain.AddresslistVotingRepoProxy =
deployment.addresslistVotingRepo.address;
contextParamsLocalChain.TokenVotingRepoProxy =
deployment.tokenVotingRepo.address;
contextParamsLocalChain.MultisigSetup =
deployment.multisigPluginSetup.address;
contextParamsLocalChain.AdminSetup = "";
contextParamsLocalChain.AddresslistVotingSetup =
deployment.addresslistVotingPluginSetup.address;
contextParamsLocalChain.TokenVotingSetup =
Expand Down
2 changes: 1 addition & 1 deletion modules/client/test/integration/core-modules/ipfs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const TEST_WALLET =
const contextParamsMainnet: ContextParams = {
network: "mainnet",
signer: new Wallet(TEST_WALLET),
DAOFactory: "0x0123456789012345678901234567890123456789",
DAOFactory: `0x${'0123456789'.repeat(4)}`,
web3Providers: web3endpoints.working,
ipfsNodes: [
{
Expand Down

0 comments on commit f2b6704

Please sign in to comment.