Skip to content

Commit

Permalink
Merge pull request #52 from ixofoundation/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Michael-Ixo authored Nov 20, 2023
2 parents 1f30d71 + 79882ca commit aa6917f
Show file tree
Hide file tree
Showing 30 changed files with 1,000 additions and 350 deletions.
4 changes: 2 additions & 2 deletions __tests__/flows/claims.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ export const supamotoClaims = () =>
testMsg("/ixo.claims.v1beta1.MsgCreateCollection", async () => {
// add wait according to chunk index for ipfs rate limit
console.log(
"waiting 10 mintues as blocksync needs 5 minutes to load all ipfs files for entity external Ids"
"waiting 5 mintues as blocksync needs 5 minutes to load all ipfs files for entity external Ids"
);
await timeout(1000 * 60 * 10);
await timeout(1000 * 60 * 5);

const res = await Claims.CreateCollectionSupamotoGenesis(
dids.assetCollection,
Expand Down
2 changes: 1 addition & 1 deletion __tests__/flows/cosmwasm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ export const devnetSwapContract_IXO_CARBON = () => {
);

let contractAddress1155 =
"ixo1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrqvg5w3c";
"ixo1xr3rq8yvd7qplsw5yx90ftsr2zdhg4e9z60h5duusgxpv72hud3sq0mjl6";

let tokenIds: string[] = [];
test("Query token ids", async () => {
Expand Down
5 changes: 3 additions & 2 deletions __tests__/flows/instantiateProposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ export const devnetProposals = () =>
contractPaths.slice(12, 16),
contractPaths.slice(16, 20),
contractPaths.slice(20, 24),
contractPaths.slice(24),
contractPaths.slice(24, 28),
contractPaths.slice(28),
];

let i: number;
Expand All @@ -161,7 +162,7 @@ export const devnetProposals = () =>
c.name,
c.path,
signer,
ii * 0.5
ii * 0.75
);
})
);
Expand Down
13 changes: 12 additions & 1 deletion __tests__/flows/quickQueries.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Long from "long";
import { createRegistry, utils } from "../../src";
import { cosmos, createRegistry, utils } from "../../src";
import { getUser, queryClient } from "../helpers/common";
import { RPC_URL, WalletUsers } from "../helpers/constants";
import { AuthInfo, TxBody } from "../../src/codegen/cosmos/tx/v1beta1/tx";
Expand Down Expand Up @@ -196,6 +196,17 @@ export const quickQueries = () =>
// expect(res).toBeTruthy();
// });

// test("Query proposal by id", async () => {
// const res = await queryClient.cosmos.gov.v1beta1.proposals({
// proposalStatus:
// cosmos.gov.v1beta1.ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,
// voter: "",
// depositor: "",
// });
// console.log(res.pagination);
// expect(res).toBeTruthy();
// });

// test("Query user balance", async () => {
// const address = (await getUser(WalletUsers.alice).getAccounts())[0]
// .address;
Expand Down
12 changes: 12 additions & 0 deletions __tests__/flows/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,18 @@ export const supamotoTokensFarm = () =>
);
const allEntities = collections.data[0].entities;

// helpers to get a number of stove ids
// const ent100 = allEntities
// .map((e: any) => ({ id: e.id, type: e.type }))
// .slice(0, 100);
// console.log("ent100", ent100.length);
// saveFileToPath(
// ["documents", "emerging", "100entities.json"],
// JSON.stringify(ent100, null, 2)
// );
// const haha = true;
// if (haha) throw new Error("haha");

const farm = false;
const topup = false;
const chunkSize = 40;
Expand Down
8 changes: 5 additions & 3 deletions __tests__/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,20 @@ IID.generateBlockchainTestUsers();
// ------------------------------------------
// Proposals.devnetProposals();
//
// first run above devnetProposals, the run initcontracts.sh on dev server
// first run above devnetProposals, the run 'bash initcontracts.sh' on dev server
// immidiately, and wait for all proposals to pass then run below
//
// After all proposals have passed, run
// CosmWasm.multicallContract();
//
// After the contract constants is generated, run below
// - `yarn test:supamoto` to create all base daos and entities for emerging and ecs,
// - `yarn test:umuzi` to create all base daos and entities for yoma and umuzi (Dont run yet!!!!!),
// please ensure to have the env vars set for dao root users and ed key users. For devnet restart
// you dont have to save did constants after dao creation, it deterministic so preset to devnet dids
//
// After daos is on devnet you can run the below
// IID.registerIidsDev();
// CosmWasm.multicallContract();
// CosmWasm.devnetSwapContract_IXO_CARBON();
// Token.supamotoTokens();
// CosmWasm.devnetSwapContract_IXO_CARBON();
// Claims.supamotoClaims();
36 changes: 30 additions & 6 deletions __tests__/modules/Entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ export const CreateEntity = async (
}),
};

const response = await client.signAndBroadcast(myAddress, [message], fee);
const response = await client.signAndBroadcast(
myAddress,
[message],
getFee(1, await client.simulate(myAddress, [message], undefined))
);
return response;
};

Expand Down Expand Up @@ -80,7 +84,15 @@ export const TransferEntity = async (
}));

// console.log({ myAddress });
const response = await client.signAndBroadcast(myAddress, messages, fee);
const response = await client.signAndBroadcast(
myAddress,
messages,
getFee(
messages.length,
await client.simulate(myAddress, messages, undefined)
),
"ECS to Sigma"
);
return response;
};

Expand Down Expand Up @@ -118,7 +130,11 @@ export const UpdateEntity = async (data: {
}),
};

const response = await client.signAndBroadcast(myAddress, [message], fee);
const response = await client.signAndBroadcast(
myAddress,
[message],
getFee(1, await client.simulate(myAddress, [message], undefined))
);
return response;
};

Expand Down Expand Up @@ -146,7 +162,7 @@ export const UpdateEntityVerified = async (
const response = await client.signAndBroadcast(
myAddress,
messages,
getFee(messages.length)
getFee(1, await client.simulate(myAddress, messages, undefined))
);
return response;
};
Expand All @@ -169,7 +185,11 @@ export const CreateEntityAccount = async (
}),
};

const response = await client.signAndBroadcast(tester, [message], fee);
const response = await client.signAndBroadcast(
tester,
[message],
getFee(1, await client.simulate(tester, [message], undefined))
);
return response;
};

Expand Down Expand Up @@ -208,7 +228,11 @@ export const GrantEntityAccountAuthz = async (
}),
};

const response = await client.signAndBroadcast(tester, [message], fee);
const response = await client.signAndBroadcast(
tester,
[message],
getFee(1, await client.simulate(tester, [message], undefined))
);
return response;
};
export function CreateEntityAssetSupamotoInstance(
Expand Down
5 changes: 2 additions & 3 deletions __tests__/setup/Entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -641,14 +641,13 @@ export const CreateEntityAssetUmuziInstance = async (
encrypted: "false",
right: "",
},
// TODO need this! Alwyn to edit after creation on devnet
{
id: `{id}#profile`,
type: "Settings",
description: "Profile",
mediaType: "application/ld+json",
serviceEndpoint: "ipfs:",
proof: "",
serviceEndpoint: "ipfs:bafkreifmrku4sfl4nkly25ag4ojwsqzct2utf5yaus6hfsh2zsmhyjqxmq",
proof: "bafkreifmrku4sfl4nkly25ag4ojwsqzct2utf5yaus6hfsh2zsmhyjqxmq",
encrypted: "false",
right: "",
},
Expand Down
Loading

0 comments on commit aa6917f

Please sign in to comment.