-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from ixofoundation/develop
Develop
- Loading branch information
Showing
263 changed files
with
2,310 additions
and
18,739 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,86 @@ | ||
import { testMsg, utils } from "../helpers/common"; | ||
import * as Claims from "../modules/Claims"; | ||
import * as Cosmos from "../modules/Cosmos"; | ||
import * as Entity from "../modules/Entity"; | ||
import { WalletUsers } from "../helpers/constants"; | ||
|
||
export const claimsBasic = () => | ||
describe("Testing the Claims module", () => { | ||
// Create protocol | ||
let protocol = "did:ixo:entity:eaff254f2fc62aefca0d831bc7361c14"; | ||
// testMsg("/ixo.entity.v1beta1.MsgCreateEntity protocol", async () => { | ||
// const res = await Entity.CreateEntity( | ||
// "protocol", | ||
// undefined, | ||
// WalletUsers.charlie | ||
// ); | ||
// protocol = utils.common.getValueFromEvents(res, "wasm", "token_id"); | ||
// console.log({ protocol }); | ||
// return res; | ||
// }); | ||
// get from entity creation rawLog below | ||
let adminAccount = "ixo1kqmtxkggcqa9u34lnr6shy0euvclgatw4f9zz5"; | ||
// testMsg( | ||
// "/ixo.entity.v1beta1.MsgCreateEntity protocol", | ||
// async () => { | ||
// const res = await Entity.CreateEntity( | ||
// "protocol", | ||
// undefined, | ||
// WalletUsers.charlie | ||
// ); | ||
// protocol = utils.common.getValueFromEvents(res, "wasm", "token_id"); | ||
// console.log({ protocol }); | ||
// return res; | ||
// }, | ||
// true | ||
// ); | ||
|
||
// helper to send funds to an admin account | ||
// testMsg("test Bank Send to admin account", () => | ||
// Cosmos.BankSendTrx(100000000, WalletUsers.tester, undefined, adminAccount) | ||
// ); | ||
|
||
// check the rawLog from below test to get collectionId | ||
let collectionId = "1"; | ||
// testMsg("/ixo.claims.v1beta1.MsgCreateCollection", async () => { | ||
// const res = await Claims.CreateCollection(protocol, protocol); | ||
// console.log(res.rawLog); | ||
// return res; | ||
// }); | ||
// testMsg( | ||
// "/ixo.claims.v1beta1.MsgCreateCollection", | ||
// () => Claims.CreateCollection(protocol, protocol, adminAccount), | ||
// true | ||
// ); | ||
|
||
let claimId = "1"; | ||
// testMsg("/ixo.claims.v1beta1.MsgSubmitClaim", async () => { | ||
// const res = await Claims.SubmitClaim(claimId, collectionId); | ||
// console.log(res.rawLog); | ||
// return res; | ||
// }); | ||
|
||
// testMsg("/ixo.claims.v1beta1.MsgEvaluateClaim", async () => { | ||
// const res = await Claims.EvaluateClaim(claimId, collectionId); | ||
// console.log(res.rawLog); | ||
// return res; | ||
// }); | ||
|
||
// testMsg("/ixo.claims.v1beta1.MsgDisputeClaim", () => | ||
// Claims.DisputeClaim(claimId, "proof1") | ||
// ); | ||
|
||
// testMsg("/ixo.claims.v1beta1.MsgWithdrawPayment", () => | ||
// Claims.WithdrawPayment(claimId) | ||
// testMsg( | ||
// "/ixo.entity.v1beta1.MsgGrantEntityAccountAuthz agent submit", | ||
// () => | ||
// Claims.GrantEntityAccountClaimsSubmitAuthz( | ||
// protocol, | ||
// "admin", | ||
// adminAccount, | ||
// collectionId, | ||
// 10 | ||
// ), | ||
// true | ||
// ); | ||
|
||
// testMsg("/cosmos.authz.v1beta1.MsgGrant agent submit", () => | ||
// Claims.MsgGrantAgentSubmit(collectionId, 10) | ||
// testMsg("/cosmos.authz.v1beta1.MsgExec agent submit", () => | ||
// Claims.MsgExecAgentSubmit(claimId, collectionId, adminAccount) | ||
// ); | ||
|
||
// testMsg("/cosmos.authz.v1beta1.MsgExec agent submit", async () => { | ||
// const res = await Claims.MsgExecAgentSubmit(claimId, collectionId); | ||
// console.log(res.rawLog); | ||
// return res; | ||
// }); | ||
|
||
// testMsg("/cosmos.authz.v1beta1.MsgGrant agent evaluate", () => | ||
// Claims.MsgGrantAgentEvaluate(collectionId, [], 10) | ||
// testMsg( | ||
// "/ixo.entity.v1beta1.MsgGrantEntityAccountAuthz agent evaluate", | ||
// () => | ||
// Claims.GrantEntityAccountClaimsEvaluateAuthz( | ||
// protocol, | ||
// "admin", | ||
// adminAccount, | ||
// collectionId, | ||
// [], | ||
// 10 | ||
// ), | ||
// true | ||
// ); | ||
|
||
// testMsg("/cosmos.authz.v1beta1.MsgExec agent evaluate", () => | ||
// Claims.MsgExecAgentEvaluate(claimId, collectionId) | ||
// testMsg( | ||
// "/cosmos.authz.v1beta1.MsgExec agent evaluate", | ||
// () => Claims.MsgExecAgentEvaluate(claimId, collectionId, adminAccount), | ||
// true | ||
// ); | ||
|
||
// testMsg("/cosmos.authz.v1beta1.MsgExec withdraw payment", () => | ||
// Claims.MsgExecWithdrawal(claimId) | ||
// Claims.MsgExecWithdrawal(claimId, adminAccount) | ||
// ); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.