Skip to content

Commit

Permalink
Add Encointer and adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TarikGul committed Sep 11, 2024
1 parent cb4c9fd commit fd09901
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/hw-ledger/src/defaults.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

import { supportedApps } from '@zondax/ledger-substrate';

import { ledgerApps } from './defaults.js';
import { prevLedgerRecord } from './defaults.js';

describe('ledgerApps', (): void => {
for (const k of Object.keys(ledgerApps)) {
for (const k of Object.keys(prevLedgerRecord)) {
it(`${k} is available in @zondax/ledger-substrate`, (): void => {
expect(
supportedApps.find(({ name }) =>
name === ledgerApps[k]
name === prevLedgerRecord[k]
)
).toBeDefined();
});
Expand Down
20 changes: 17 additions & 3 deletions packages/hw-ledger/src/defaults.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// Copyright 2017-2024 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0

// These match up with the keys of the knownLedger object in the @polkadot/networks/defaults/ledger.ts
// and maps to the known name in the @zondax/ledger-substrate/supported_apps package
export const ledgerApps: Record<string, string> = {
// These map to the known name in the @zondax/ledger-substrate/supported_apps package
// but they do not reflect all ledger apps that are supported. Since ledger now has support for all
// substrate chains via the PolkadotGenericApp, any new chains that need ledger support can be added to
// `genericLedgerApps` below.
export const prevLedgerRecord: Record<string, string> = {
acala: 'Acala',
ajuna: 'Ajuna',
'aleph-node': 'AlephZero',
Expand Down Expand Up @@ -45,3 +47,15 @@ export const ledgerApps: Record<string, string> = {
xxnetwork: 'XXNetwork',
zeitgeist: 'Zeitgeist'
};

// Any chains moving forward that are supported by the PolkadotGenericApp from ledger will input their names below.
export const genericLedgerApps = {
encointer: 'Encointer',
integritee: 'Integritee'
};

// These match up with the keys of the knownLedger object in the @polkadot/networks/defaults/ledger.ts
export const ledgerApps: Record<string, string> = {
...prevLedgerRecord,
...genericLedgerApps
};
7 changes: 7 additions & 0 deletions packages/networks/src/defaults/genesis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ export const knownGenesis: KnownGenesis = {
edgeware: [
'0x742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b'
],
encointer: [
'0x7dd99936c1e9e6d1ce7d90eb6f33bea8393b4bf87677d675aa63c9cb3e8c5b5b'
],
enjin: [
'0xd8761d3c88f26dc12875c00d3165f7d67243d56fc85b4cf19937601a7916e5a9'
],
Expand All @@ -72,6 +75,10 @@ export const knownGenesis: KnownGenesis = {
'0x3d75507dd46301767e601265791da1d9cb47b6ebc94e87347b635e5bf58bd047', // Snakenet Gen2
'0x0ed32bfcab4a83517fac88f2aa7cbc2f88d3ab93be9a12b6188a036bf8a943c2' // Snakenet Gen1
],
integritee: [
'0xcdedc8eadbfa209d3f207bba541e57c3c58a667b05a2e1d1e86353c9000758da', // on Kusama
'0xe13e7af377c64e83f95e0d70d5e5c3c01d697a84538776c5b9bbe0e7d7b6034c' // on Polkadot
],
'interlay-parachain': [
'0xbf88efe70e9e0e916416e8bed61f2b45717f517d7f3523e33c7b001e5ffcbc72'
],
Expand Down
2 changes: 2 additions & 0 deletions packages/networks/src/defaults/ledger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ export const knownLedger: KnownLedger = {
darwinia: 0x00000162,
'dock-mainnet': 0x00000252,
edgeware: 0x0000020b,
encointer: 0x000001b2,
enjin: 0x00000483,
equilibrium: 0x05f5e0fd,
genshiro: 0x05f5e0fc,
hydradx: 0x00000162,
integritee: 0x000007df,
'interlay-parachain': 0x00000162,
karura: 0x000002ae,
khala: 0x000001b2,
Expand Down

0 comments on commit fd09901

Please sign in to comment.