Skip to content

Commit

Permalink
feat: removal of hedera network
Browse files Browse the repository at this point in the history
  • Loading branch information
rongquan1 committed Dec 5, 2024
1 parent a96dba0 commit 95afd53
Show file tree
Hide file tree
Showing 15 changed files with 4,192 additions and 1,788 deletions.
5,282 changes: 4,183 additions & 1,099 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@
"@govtechsg/oa-encryption": "^1.3.5",
"@govtechsg/open-attestation-utils": "1.0.9",
"@reduxjs/toolkit": "^1.6.1",
"@tradetrust-tt/decentralized-renderer-react-components": "^3.14.1",
"@tradetrust-tt/document-store": "^3.2.0",
"@tradetrust-tt/token-registry": "^4.14.0",
"@tradetrust-tt/tradetrust": "^6.9.4",
"@tradetrust-tt/tradetrust-ui-components": "^2.22.2",
"@tradetrust-tt/tradetrust-utils": "^1.14.1",
"@tradetrust-tt/decentralized-renderer-react-components": "^3.14.3",
"@tradetrust-tt/document-store": "^4.1.0",
"@tradetrust-tt/token-registry": "^4.15.0",
"@tradetrust-tt/tradetrust": "^6.9.7",
"@tradetrust-tt/tradetrust-ui-components": "^2.22.3",
"@tradetrust-tt/tradetrust-utils": "^1.14.3",
"@tradetrust-tt/tt-verify": "^8.10.2",
"@types/gtag.js": "0.0.8",
"buffer": "^6.0.3",
Expand Down
59 changes: 0 additions & 59 deletions public/static/demo/hederamainnet.tt

This file was deleted.

59 changes: 0 additions & 59 deletions public/static/demo/hederatestnet.tt

This file was deleted.

Binary file removed public/static/images/networks/hedera.png
Binary file not shown.
9 changes: 1 addition & 8 deletions src/config/chain-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,11 @@ export const MAIN_NETWORKS = [
ChainId.Ethereum, //
ChainId.Polygon,
ChainId.XDC,
ChainId.HederaMainnet,
ChainId.Stability,
ChainId.Astron,
];

/**
* Supported networks in development environment
*/
export const TEST_NETWORKS = [
ChainId.Sepolia,
ChainId.Amoy,
ChainId.APOTHEM,
ChainId.StabilityTestnet,
ChainId.HederaTestnet,
];
export const TEST_NETWORKS = [ChainId.Sepolia, ChainId.Amoy, ChainId.APOTHEM, ChainId.StabilityTestnet];
41 changes: 1 addition & 40 deletions src/constants/chain-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,7 @@ export interface ChainInfoObject {
export const InitialAddress = "0x0000000000000000000000000000000000000000";
export const BurnAddress = "0x000000000000000000000000000000000000dEaD";

export const AvailableBlockChains: string[] = [
"ETH",
"MATIC",
"XDC",
"HBAR",
"FREE",
"ASTRON",
] satisfies networkCurrency[];
export const AvailableBlockChains: string[] = ["ETH", "MATIC", "XDC", "FREE", "ASTRON"] satisfies networkCurrency[];

type ChainInfo = Record<ChainId, ChainInfoObject>;

Expand All @@ -50,10 +43,6 @@ export enum ChainId {
Stability = 101010,
StabilityTestnet = 20180427,

// Hedera Network
HederaMainnet = 295,
HederaTestnet = 296,

// Astron Network
Astron = 1338,
}
Expand Down Expand Up @@ -174,34 +163,6 @@ export const ChainInfo: ChainInfo = {
decimals: 18,
},
},
[ChainId.HederaMainnet]: {
label: "Hedera Mainnet",
chainId: ChainId.HederaMainnet,
iconImage: "/static/images/networks/hedera.png",
networkName: "hederamainnet",
networkLabel: "Hedera Mainnet",
explorerUrl: "https://hashscan.io/mainnet",
rpcUrl: "https://hedera-mainnet-json-rpc.krypc.com/",
nativeCurrency: {
name: "HBAR",
symbol: "HBAR",
decimals: 18,
},
},
[ChainId.HederaTestnet]: {
label: "Hedera Testnet",
chainId: ChainId.HederaTestnet,
iconImage: "/static/images/networks/hedera.png",
networkName: "hederatestnet",
networkLabel: "Hedera Testnet",
explorerUrl: "https://hashscan.io/testnet",
rpcUrl: "https://hedera-testnet-json-rpc.krypc.com/",
nativeCurrency: {
name: "HBAR",
symbol: "HBAR",
decimals: 18,
},
},
[ChainId.Astron]: {
label: "Astron Network",
chainId: ChainId.Astron,
Expand Down
7 changes: 0 additions & 7 deletions src/test/dns-txt-verified.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,3 @@ 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: 1 addition & 27 deletions 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, ACCOUNT_4 } from "../../tests/e2e/utils";
import { ACCOUNT_1, ACCOUNT_2 } from "../../tests/e2e/utils";

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

Expand All @@ -19,8 +19,6 @@ 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 @@ -56,27 +54,3 @@ 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);
});
Loading

0 comments on commit 95afd53

Please sign in to comment.