Skip to content

Commit

Permalink
feat(hedera): added demo TT file for hedera mainnet network : krypc (#…
Browse files Browse the repository at this point in the history
…885)

* feat(hedera): added support for hedera network

* feat(hedera): added demo TT file for hedera network : krypc

* feat(hedera): added demo TT file for hedera mainnet network : krypc

* feat: hedera added test files :krypc

* feat: hedera updated mainnet RPC url :krypc

* feat: hedera updated testnet RPC url :krypc
  • Loading branch information
AnithaKrypC authored Sep 3, 2024
1 parent 8469fc5 commit b2c94e3
Show file tree
Hide file tree
Showing 11 changed files with 579 additions and 3 deletions.
59 changes: 59 additions & 0 deletions public/static/demo/hederamainnet.tt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"version": "https://schema.openattestation.com/2.0/schema.json",
"data": {
"$template": {
"name": "cc444599-34bd-481b-b37d-ef499cc32fde:string:CERTIFICATE_OF_NON_MANIPULATION",
"type": "e47906b2-e699-491b-8b3f-76102c4c1ca3:string:EMBEDDED_RENDERER",
"url": "2bde1a46-fd8c-45fc-b7a6-3f04eef9a765:string:https://demo-cnm.openattestation.com"
},
"recipient": {
"name": "7e9029b7-2ed9-4e3e-98d6-8ed6ed2d55b9:string:XYZ",
"address": {
"street": "281a036a-f4a7-48a8-b9c7-d089fac96700:string:42 BRIGADE ROAD",
"country": "b78e20fd-97ec-4442-961f-a16bb2ef4c25:string:INDIA"
}
},
"issuers": [
{
"name": "6c9cfd13-329b-48d8-b7d7-d09bb62f6201:string:Demo Issuer",
"documentStore": "40f21e22-0120-450c-a7d4-c9500130eb32:string:0x222B69788e2e9B7FB93a3a0fE258D4604Dc7df21",
"identityProof": {
"type": "9dd1db32-e903-4051-9099-d9557bc9311a:string:DNS-TXT",
"location": "76f85535-a72d-4278-a1dc-ff3f03194e2c:string:trustlv.org"
}
}
],
"consignment": {
"description": "cf8b93ec-b3f8-484e-a2cf-9c17fd8d0a62:string:16667 RED WINE",
"quantity": {
"value": "c32e3646-8987-41a6-ad6e-3aa4d8b39682:string:1000",
"unit": "e5a45861-1cd8-49ed-b9d0-1f80e6c77187:string:LITRES"
},
"countryOfOrigin": "73ef4de9-e065-4847-b885-7288a8c7d027:string:INDIA",
"outwardBillNo": "142e3bba-652d-4890-92f6-4073bfd17b94:string:AQSIQ170923130",
"dateOfDischarge": "67a3f36a-ee83-44b3-8358-468039023817:string:2024-03-01",
"dateOfDeparture": "39cf2cab-724d-4b7d-adef-720b4eeef37c:string:2024-03-20",
"countryOfFinalDestination": "baeb5efc-abda-40e9-b20f-e5c0faff654f:string:SINGAPORE",
"outgoingVehicleNo": "cfd1d225-e2eb-4cd8-badb-567547998af4:string:COSCO SING 074E/01-MAR"
},
"declaration": {
"name": "9830ce5b-3cad-4698-a6d9-1b4036888f42:string:JOHN",
"designation": "c87ec126-28e4-40b6-89b4-4f2c2fb73a41:string:SHIPPING MANAGER",
"date": "e3f7ed1a-bfd2-4794-94cb-e98372a934e7:string:2024-03-01"
},
"certification": {
"name": "2da26cbf-bda7-4b2e-a5b7-c29f3459ff54:string:DEMO JOHN TAN",
"designation": "c80535e7-8864-4c9e-af7a-075a5c1ee8fa:string:DEMO",
"date": "7743b1ee-2471-497f-8e3b-d69b67cb5686:string:2024-03-01",
"signature": "7bd21efc-ba18-4493-8cf1-75cdc491edd2:string:data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAB2CAMAAAAqeZcjAAAAb1BMVEX///8XGRwAAACRkZJ1dnfz8/MUFxoAAAkOEBQ+QEISExW2t7fj5OQTFRkFCQ4AAAYfISRubm/IyMjT09T5+fl7e3ydnZ4vMDKBgYLq6uqkpKWtra7Z2dlcXV5QUVNFRkc2NzgmJyplZma/v8CIiYnq/nZ7AAAF4ElEQVRogcVb2aKCIBCtKY0yQc2tRc3q/7/xZrKp4BZ5561EjrMyDMNqNZGs2/Oy2Wb70luvvTLJ/dfFOVlTZ5lENyfaw5sIRq69rshGeFf9k/iX008gwyBNMBBUw7XIPmAAz38a5jo8pQnAQQnJySVQPgwin+MCwO2FFMhJejMCeow8QGMwKTKQx/dqP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OyYi/chDW78DGFkGWXeZ7UaGsEP0lqeAqnddyfpHAsTGFtXd14wvrZjVAPcne/h5XT83/YjFTLznJbr6DB4OIbTe/za7FtNam9lpahjuhfighLl0w8+vjSb8umC0Ss6sikvHA5bNHi34EX//6r1LlkYdeV3HS5MnajBYR9y8JF+58fUURqcQ4cyOzwuAMZb+KBTP/x09PPXyOPn7Ls2pWXOH7quAp7gvWZ62zSH7ZJR4v6/cFMEkeLCg2KT5rZWaKj3oNU6dhYm97MIkuc+Cvn5eZm9pA8Zzt49SH5j1oCpEk1I8I76377RQOEfrdzQ6bbPaQ2k56Q7vBuI9ib0K9ogtIptiapladcrpXHbOOSRzjqQOOSrA27XzBDNKlNy1hTmj+tKa16gePig75c1UtPuQWvGGedqXhlZsPhdnrD4apKaUVfJoZ0antlPK+9stqNzW8mvdylj3anmeWpbLTOwvjW2UajOiYTu5G6jcLOjEbh+3TDuHTaonuvK4RB2moFR/PyFFUT+H7zVOjZCjYFNFux36wmc7MFx24Bf1reoYji6zMIqo735zWO8qqW0q7mkG86Ua0NtIGrclejwV91jQTD9osG/zed0+nXGXbw+P4CxzGdeHkD+2ZujZzjPZBRhUcbG7uqUlEYbEsgA8J2MXiZY/hKkBX4pdp+KCSsH47JRFfQ6Rrd69sp7UtXXhYHppJNJVm357VzxWwyl3+oR2ZAbpghWQAAAABJRU5ErkJggg=="
}
},
"signature": {
"type": "SHA3MerkleProof",
"targetHash": "0cda0ec1754fa42a811bcec8848b4908739c1df832d0e3ca7f2ffbe251e4c975",
"proof": [
"5689504a0fc648038b9318ec5eb474c42d25a7273fa3b638df6bad0789246887"
],
"merkleRoot": "5795603de7b07c96293a177efb5207d051c9b26d13aeb3a760c48b757bffde7a"
}
}
4 changes: 2 additions & 2 deletions src/constants/chain-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export const ChainInfo: ChainInfo = {
networkName: "hederamainnet",
networkLabel: "Hedera Mainnet",
explorerUrl: "https://hashscan.io/mainnet",
rpcUrl: "https://mainnet.hashio.io/api",
rpcUrl: "https://hedera-mainnet-json-rpc.krypc.com/",
nativeCurrency: {
name: "HBAR",
symbol: "HBAR",
Expand All @@ -184,7 +184,7 @@ export const ChainInfo: ChainInfo = {
networkName: "hederatestnet",
networkLabel: "Hedera Testnet",
explorerUrl: "https://hashscan.io/testnet",
rpcUrl: "https://testnet.hashio.io/api",
rpcUrl: "https://hedera-testnet-json-rpc.krypc.com/",
nativeCurrency: {
name: "HBAR",
symbol: "HBAR",
Expand Down
7 changes: 7 additions & 0 deletions src/test/dns-txt-verified.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ test("sample document is rendered correctly when DNS TXT is verified", async ()
await validateIssuerTexts(["EXAMPLE.TRADETRUST.IO"]);
await validateIframeTexts(["INVOICE"]);
});

test("sample document is rendered correctly when DNS TXT is verified for hederatestnet", async () => {
await navigateToVerify();
await uploadDocument("./fixture/hederatestnet/v2/invoice.json");
await validateIssuerTexts(["TRUSTLV.ORG"]);
await validateIframeTexts(["CERTIFICATE OF NON-MANIPULATION"]);
});
28 changes: 27 additions & 1 deletion src/test/endorsement-chain.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Selector } from "testcafe";
import { location, navigateToVerify, uploadDocument, validateIssuerTexts } from "./helper";
import { ACCOUNT_1, ACCOUNT_2 } from "../../tests/e2e/utils";
import { ACCOUNT_1, ACCOUNT_2, ACCOUNT_4 } from "../../tests/e2e/utils";

fixture("Endorsement Chain Rendering").page`${location}`;

Expand All @@ -19,6 +19,8 @@ const ChangeOwnershipAction = Selector("[data-testid='action-title']").withText(
const SurrenderToIssuerAction = Selector("[data-testid='action-title']").withText("Document surrendered to issuer");
const SurrenderAcceptedAction = Selector("[data-testid='action-title']").withText("Surrender of document accepted");

const EndorsementChainAddress4 = Selector("[data-testid='address-entity']").withText(ACCOUNT_4);

// history chain of events for ebl-endorsement-chain.json are:
// 1. issued on account 1
// 2. nominate beneficiary + change owners to account 2
Expand Down Expand Up @@ -54,3 +56,27 @@ test("Endorsement chain title and actions are rendered correctly", async (t) =>
await t.expect(SurrenderToIssuerAction.count).eql(1);
await t.expect(SurrenderAcceptedAction.count).eql(1);
});

test("Endorsement chain title and actions are rendered correctly for hederatestnet", async (t) => {
await navigateToVerify();
await uploadDocument("./fixture/hederatestnet/v3/ebl-endorsement-chain.json");

await validateIssuerTexts(["TRUSTLV.ORG"]);
await t.wait(3000);
await t.expect(ViewEndorsementChainButton.count).eql(1);
await t.click(ViewEndorsementChainButton);

// add wait 3000 due to endorsement chain component having a little latency because getting endorsement data
await t.wait(5000);
await t.expect(EndorsementChainTitle.count).eql(1);

await t.expect(EndorsementChainAddress4.count).eql(0);

await t.expect(DocumentIssuedAction.count).eql(6);
await t.expect(EndorseNomineeAction.count).eql(0);
await t.expect(ChangeOwnershipAction.count).eql(0);
await t.expect(TransferHoldershipAction.count).eql(0);

await t.expect(SurrenderToIssuerAction.count).eql(0);
await t.expect(SurrenderAcceptedAction.count).eql(0);
});
63 changes: 63 additions & 0 deletions src/test/fixture/hederamainnet/v2/invoice.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"version": "https://schema.openattestation.com/2.0/schema.json",
"data": {
"$template": {
"name": "3763c5e5-1c5e-49dd-bcfc-8aaa51fdc85a:string:CERTIFICATE_OF_NON_MANIPULATION",
"type": "b939c544-1de9-4768-ab82-6517232efb97:string:EMBEDDED_RENDERER",
"url": "a8332ab2-e484-4a1c-b8a4-9f2f002657bb:string:https://demo-cnm.openattestation.com"
},
"recipient": {
"name": "faaf525e-6115-4115-930e-1a35eeca1d71:string:XYZ",
"address": {
"street": "e0897ec4-7511-4147-8a14-65b824aa860d:string:42 BRIGADE ROAD",
"country": "94a3ee9f-7eaf-47d0-af2a-65826c13b6ab:string:INDIA"
}
},
"issuers": [
{
"name": "25f6bd9f-20b0-446d-a80f-061003c881b7:string:Demo Issuer",
"documentStore": "8383cb58-49d6-4fb0-be97-87f2b0b1610b:string:0x222B69788e2e9B7FB93a3a0fE258D4604Dc7df21",
"identityProof": {
"type": "123147c9-172d-4f19-bc6f-365fc4851faf:string:DNS-TXT",
"location": "ede8e34c-21a4-44f0-b152-6cfaa9819c6f:string:trustlv.org"
}
}
],
"network": {
"chain": "cc57fe8a-bf4e-4595-8f78-aee3744a4899:string:HBAR",
"chainId": "1684a834-2604-4a82-8575-1f7b27f16255:string:295"
},
"consignment": {
"description": "59e5bc32-6932-4f4e-9cda-a3f1c7ddc3f5:string:16667 RED WINE",
"quantity": {
"value": "f726db02-dbac-4426-928a-72a3fefb1c4f:string:1000",
"unit": "afa04f03-47a0-4a1d-9742-78a04d8c50f9:string:LITRES"
},
"countryOfOrigin": "99c915fa-fda0-4c0a-90e7-06d344630a8d:string:INDIA",
"outwardBillNo": "d93e768e-a7fc-4f0f-8934-1faf8e3f7f93:string:AQSIQ170923130",
"dateOfDischarge": "624f0420-ae81-4755-88f7-b84549f9373d:string:2024-03-01",
"dateOfDeparture": "d226bc01-dc5b-4462-80e3-421133e8d5f6:string:2024-03-20",
"countryOfFinalDestination": "76a15669-e817-49ec-ad0f-b1dfa0a993da:string:SINGAPORE",
"outgoingVehicleNo": "89627e8a-cb46-4456-b936-8522786eec29:string:COSCO SING 074E/01-MAR"
},
"declaration": {
"name": "8cf98366-08a7-4a85-8f2b-1fdae9a615b1:string:JOHN",
"designation": "7ceeb5b0-0baa-4676-b890-c816594402b7:string:SHIPPING MANAGER",
"date": "3a71b67a-0bbb-4d06-b4be-b0b6ca9211b4:string:2024-03-01"
},
"certification": {
"name": "aa3b0dba-00c6-4954-a919-c24138c0e9d5:string:DEMO JOHN TAN",
"designation": "1864c780-107c-4afb-8235-babd33369d5a:string:DEMO",
"date": "1f26940b-9541-450a-ac96-91c269a367da:string:2024-03-01",
"signature": "e34875da-d349-47b1-9ca9-33908f0974d8:string:data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAB2CAMAAAAqeZcjAAAAb1BMVEX///8X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ErkJggg=="
}
},
"signature": {
"type": "SHA3MerkleProof",
"targetHash": "f29106db58ddb9d503b3dcc192b41ba55199bb2c2e650f382c74c25eb5a4871d",
"proof": [
"3b5bd1d45c85dc89be85953ff286c969b1f3feac240f4d8599912a67a3c36fa9"
],
"merkleRoot": "47694d88eba9e8ff8136f56e16e7b90241520b0f65f99017275d64d46135aab3"
}
}
Loading

0 comments on commit b2c94e3

Please sign in to comment.