Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
josemarinas committed Feb 6, 2024
1 parent 5f66a16 commit e83e03e
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 27 deletions.
2 changes: 1 addition & 1 deletion modules/client-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"typescript": "^5.2.2"
},
"dependencies": {
"@aragon/osx-commons-configs": "^0.0.2",
"@aragon/osx-commons-configs": "^0.2.0",
"@aragon/osx-ethers": "^1.3.1",
"@aragon/osx-ethers-v1.0.0": "npm:@aragon/[email protected]",
"@aragon/sdk-ipfs": "^1.1.0",
Expand Down
7 changes: 4 additions & 3 deletions modules/client-common/test/unit/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
TEST_WALLET_ADDRESS,
web3endpoints,
} from "../constants";
import { SupportedNetworks } from "@aragon/osx-commons-configs";
class TestContext extends ContextCore {
constructor(params?: Partial<ContextParams>) {
super(params);
Expand Down Expand Up @@ -41,7 +42,7 @@ describe("Test an extended client", () => {
expect(provider).toBeDefined();

const networkName = client.web3.getNetworkName();
expect(networkName).toBe("homestead");
expect(networkName).toBe(SupportedNetworks.MAINNET);

const signer = client.web3.getConnectedSigner();
expect(signer).toBeDefined();
Expand All @@ -67,7 +68,7 @@ describe("Test an extended client", () => {
expect(client.graphql).toBeDefined();

const networkName = client.web3.getNetworkName();
expect(networkName).toBe("homestead");
expect(networkName).toBe(SupportedNetworks.MAINNET);

expect(() => client.web3.getProvider()).toThrowError(NoProviderError);
expect(() => client.web3.getConnectedSigner()).toThrowError(NoSignerError);
Expand Down Expand Up @@ -97,7 +98,7 @@ describe("Test an extended client", () => {
expect(client.graphql).toBeDefined();

const networkName = client.web3.getNetworkName();
expect(networkName).toBe("baseGoerli");
expect(networkName).toBe(SupportedNetworks.BASE_GOERLI);
const signer = client.web3.getConnectedSigner();
expect(signer).toBeDefined();
expect(await signer.getAddress()).toBe(TEST_WALLET_ADDRESS);
Expand Down
16 changes: 8 additions & 8 deletions modules/client-common/test/unit/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("Context instances", () => {
expect(context.getAddress(ContractNames.DAO_FACTORY)).toBe(
contracts.mainnet["v1.3.0"]?.DAOFactory.address,
);
expect(context.ensRegistryAddress).toBe(context.network.ensAddress);
expect(context.getAddress(ContractNames.ENS_REGISTRY)).toBe(context.network.ensAddress);
expect(context.gasFeeEstimationFactor).toBe(0.625);
expect(context.web3Providers.length).toBe(0);
expect(context.ipfs.length).toBe(
Expand Down Expand Up @@ -71,7 +71,7 @@ describe("Context instances", () => {
expect(context.getAddress(ContractNames.DAO_FACTORY)).toBe(
contextParams.DAOFactory,
);
expect(context.ensRegistryAddress).toBe(context.network.ensAddress);
expect(context.getAddress(ContractNames.ENS_REGISTRY)).toBe(context.network.ensAddress);
expect(context.gasFeeEstimationFactor).toBe(
contextParams.gasFeeEstimationFactor,
);
Expand Down Expand Up @@ -125,7 +125,7 @@ describe("Context instances", () => {
expect(context.getAddress(ContractNames.DAO_FACTORY)).toBe(
contracts.goerli["v1.3.0"]?.DAOFactory.address,
);
expect(context.ensRegistryAddress).toBe(context.network.ensAddress);
expect(context.getAddress(ContractNames.ENS_REGISTRY)).toBe(context.network.ensAddress);
expect(context.gasFeeEstimationFactor).toBe(0.625);
expect(context.web3Providers.length).toBe(1);
expect(context.ipfs.length).toBe(
Expand All @@ -152,7 +152,7 @@ describe("Context instances", () => {
expect(context.getAddress(ContractNames.DAO_FACTORY)).toBe(
contracts.polygon["v1.3.0"]?.DAOFactory.address,
);
expect(context.ensRegistryAddress).toBe(
expect(context.getAddress(ContractNames.ENS_REGISTRY)).toBe(
contracts.polygon["v1.3.0"]?.ENSRegistry?.address,
);
expect(context.gasFeeEstimationFactor).toBe(0.625);
Expand Down Expand Up @@ -185,7 +185,7 @@ describe("Context instances", () => {
expect(context.getAddress(ContractNames.DAO_FACTORY)).toBe(
contracts.polygon["v1.3.0"]?.DAOFactory.address,
);
expect(context.ensRegistryAddress).toBe(
expect(context.getAddress(ContractNames.ENS_REGISTRY)).toBe(
contracts.polygon["v1.3.0"]?.ENSRegistry?.address,
);
expect(context.gasFeeEstimationFactor).toBe(0.625);
Expand Down Expand Up @@ -232,7 +232,7 @@ describe("Context instances", () => {
expect(context.getAddress(ContractNames.DAO_FACTORY)).toBe(
contracts.polygon["v1.3.0"]?.DAOFactory.address,
);
expect(context.ensRegistryAddress).toBe(ADDRESS_ONE);
expect(context.getAddress(ContractNames.ENS_REGISTRY)).toBe(ADDRESS_ONE);
expect(context.gasFeeEstimationFactor).toBe(0.625);
expect(context.web3Providers.length).toBe(0);
expect(context.ipfs.length).toBe(
Expand Down Expand Up @@ -283,7 +283,7 @@ describe("Context instances", () => {
expect(context.getAddress(ContractNames.DAO_FACTORY)).toEqual(
contracts.polygon["v1.3.0"]?.DAOFactory.address,
);
expect(context.ensRegistryAddress).toEqual(
expect(context.getAddress(ContractNames.ENS_REGISTRY)).toEqual(
contracts.polygon["v1.3.0"]?.ENSRegistry?.address,
);
});
Expand All @@ -299,7 +299,7 @@ describe("Context instances", () => {
expect(context.getAddress(ContractNames.DAO_FACTORY)).toBe(
contracts.baseGoerli["v1.3.0"]?.DAOFactory.address,
);
expect(context.ensRegistryAddress).toBe(
expect(context.getAddress(ContractNames.ENS_REGISTRY)).toBe(
contracts.baseGoerli["v1.3.0"]?.ENSRegistry?.address,
);
expect(context.gasFeeEstimationFactor).toBe(0.625);
Expand Down
1 change: 1 addition & 0 deletions modules/client/examples/01-client/01-create-dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const metadata: DaoMetadata = {
// Through pinning the metadata in IPFS, we can get the IPFS URI. You can read more about it here: https://docs.ipfs.tech/how-to/pin-files/
const metadataUri = await client.methods.pinMetadata(metadata);


// You need at least one plugin in order to create a DAO. In this example, we'll use the TokenVoting plugin, but feel free to install whichever one best suites your needs. You can find resources on how to do this in the plugin sections.
// These would be the plugin params if you need to mint a new token for the DAO to enable TokenVoting.
const tokenVotingPluginInstallParams: TokenVotingPluginInstall = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const metadataUri: string = await multisigClient.methods.pinMetadata(
const proposalParams: CreateMultisigProposalParams = {
pluginAddress: "0x1234567890123456789012345678901234567890",
metadataUri,
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
2 changes: 1 addition & 1 deletion modules/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"typescript": "^5.2.2"
},
"dependencies": {
"@aragon/osx-commons-configs": "^0.1.0",
"@aragon/osx-commons-configs": "^0.2.0",
"@aragon/osx-ethers": "1.3.0",
"@aragon/sdk-client-common": "^1.15.0",
"@aragon/sdk-ipfs": "^1.1.0",
Expand Down
10 changes: 5 additions & 5 deletions modules/client/test/unit/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe("Context instances", () => {
expect(context.getAddress(ContractNames.DAO_FACTORY)).toBe(
contracts.mainnet["v1.3.0"]!.DAOFactory.address,
);
expect(context.ensRegistryAddress).toBe(context.network.ensAddress);
expect(context.getAddress(ContractNames.ENS_REGISTRY)).toBe(context.network.ensAddress);
expect(context.gasFeeEstimationFactor).toBe(0.625);
expect(context.web3Providers.length).toBe(0);
expect(context.ipfs.length).toBe(
Expand Down Expand Up @@ -75,7 +75,7 @@ describe("Context instances", () => {
expect(context.getAddress(ContractNames.DAO_FACTORY)).toBe(
contextParams.DAOFactory,
);
expect(context.ensRegistryAddress).toBe(context.network.ensAddress);
expect(context.getAddress(ContractNames.ENS_REGISTRY)).toBe(context.network.ensAddress);
expect(context.gasFeeEstimationFactor).toBe(
contextParams.gasFeeEstimationFactor,
);
Expand Down Expand Up @@ -129,7 +129,7 @@ describe("Context instances", () => {
expect(context.getAddress(ContractNames.DAO_FACTORY)).toBe(
contracts.goerli["v1.3.0"]!.DAOFactory.address,
);
expect(context.ensRegistryAddress).toBe(context.network.ensAddress);
expect(context.getAddress(ContractNames.ENS_REGISTRY)).toBe(context.network.ensAddress);
expect(context.gasFeeEstimationFactor).toBe(0.625);
expect(context.web3Providers.length).toBe(1);
expect(context.ipfs.length).toBe(
Expand All @@ -156,7 +156,7 @@ describe("Context instances", () => {
expect(context.getAddress(ContractNames.DAO_FACTORY)).toBe(
contracts.polygon["v1.3.0"]!.DAOFactory.address,
);
expect(context.ensRegistryAddress).toBe(
expect(context.getAddress(ContractNames.ENS_REGISTRY)).toBe(
contracts.polygon["v1.3.0"]?.ENSRegistry?.address,
);
expect(context.gasFeeEstimationFactor).toBe(0.625);
Expand Down Expand Up @@ -286,7 +286,7 @@ describe("Context instances", () => {
expect(context.getAddress(ContractNames.DAO_FACTORY)).toEqual(
contracts.polygon["v1.3.0"]?.DAOFactory.address,
);
expect(context.ensRegistryAddress).toEqual(
expect(context.getAddress(ContractNames.ENS_REGISTRY)).toEqual(
contracts.polygon["v1.3.0"]?.ENSRegistry?.address,
);
});
Expand Down
13 changes: 4 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,10 @@
"@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==
"@aragon/osx-commons-configs@^0.2.0":
version "0.2.0"
resolved "https://registry.yarnpkg.com/@aragon/osx-commons-configs/-/osx-commons-configs-0.2.0.tgz#32f83596f4a2e9e48aef61cf560c1c5b4d32a049"
integrity sha512-wCFtgmuGCzs8L5mCxVCYQ6uEu69IrofS7q2w7E1Fjk7/nWuSmRUpgmif3ki9BQq1qpOvDu2P+u3UNLnIz8J82g==
dependencies:
tslib "^2.6.2"

Expand Down

0 comments on commit e83e03e

Please sign in to comment.