Tests: build types by the app's names; fix rebrand-broken fixtures

- The static metadata in @pezkuwi/types-support predates the rename and
  only knows Pallet* names, while the app (and the test-support creation
  helpers) use PezpalletBountiesBountyStatus, PezpalletAllianceCid, ...
  createAugmentedApi now also registers the @pezkuwi/types-augment
  lookup definitions, and createLookupRegistry gives specs a plain
  registry that knows them.
- calculateBountyBond: the description had been rewritten from
  "Kusama" (24 bytes) to "Dicle" (23 bytes) with the expected bond left
  for 24; now "Pezkuwi network UI Bounty" (25 bytes) and its value.
- page-alliance had no tsconfig.spec.json, so its spec was never
  type-checked; added, and specs are excluded from its build config.
This commit is contained in:
Satoshi Qazi Muhammed authored and SatoshiQaziMuhammed committed 2026-10-10 07:12:12 +04:00
1 parent 09fbca8121
commit 9302b4ff16
11 files changed
+61 -11

No files matched your search

@@ -1,10 +1,11 @@
// Copyright 2017-2026 @pezkuwi/test-support authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Registry } from '@pezkuwi/types/types';
import type { Registry, RegistryTypes } from '@pezkuwi/types/types';
import { ApiPromise, WsProvider } from '@pezkuwi/api';
import { Metadata, TypeRegistry } from '@pezkuwi/types';
import lookupDefinitions from '@pezkuwi/types-augment/lookup/definitions';
import metaStatic from '@pezkuwi/types-support/metadata/static-bizinikiwi';
// PezkuwiChain requires AuthorizeCall signed extension for all transactions
@@ -23,6 +24,10 @@ export function createAugmentedApi (): ApiPromise {
const metadata = new Metadata(registry as unknown as Registry, metaStatic);
registry.setMetadata(metadata);
// The static metadata predates the rename and only has Pallet* names; the
// app (and the creation helpers) use the Pezpallet* lookup names.
// RegistryTypes does not model a struct's `_alias`, which the registry accepts
registry.register(lookupDefinitions.types as RegistryTypes);
const api = new ApiPromise({
provider: new WsProvider('ws://', false),
@@ -0,0 +1,20 @@
// Copyright 2017-2026 @pezkuwi/test-support authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { RegistryTypes } from '@pezkuwi/types/types';
import { TypeRegistry } from '@pezkuwi/types/create';
import lookupDefinitions from '@pezkuwi/types-augment/lookup/definitions';
// A registry that knows the runtime types by the names the app uses
// (PezpalletBountiesBountyStatus, PezpalletAllianceCid, ...). The static
// metadata in @pezkuwi/types-support predates the rename and only has the
// Pallet* names.
export function createLookupRegistry (): TypeRegistry {
const registry = new TypeRegistry();
// RegistryTypes does not model a struct's `_alias`, which the registry accepts
registry.register(lookupDefinitions.types as RegistryTypes);
return registry;
}
+1
View File
@@ -5,3 +5,4 @@ import '@pezkuwi/api-augment/bizinikiwi';
export * from './createApi.js';
export * from './createAugmentedApi.js';
export * from './createLookupRegistry.js';