XcmV2TraitsOutcome test (#4593)
* XcmV2TraitsOutcome test * Cleanup build with correct references
This commit is contained in:
@@ -30,5 +30,8 @@
|
||||
"@polkadot/types-augment": "7.9.2-3",
|
||||
"@polkadot/types-codec": "7.9.2-3",
|
||||
"@polkadot/util": "^8.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types-support": "7.9.2-3"
|
||||
}
|
||||
}
|
||||
|
||||
43
packages/api-augment/src/kusama/events.spec.ts
Normal file
43
packages/api-augment/src/kusama/events.spec.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import '@polkadot/api-augment/kusama';
|
||||
|
||||
import type { PolkadotRuntimeParachainsUmpPalletEvent, XcmV2TraitsOutcome } from '@polkadot/types/lookup';
|
||||
|
||||
import { Metadata, TypeRegistry } from '@polkadot/types';
|
||||
import metadataStatic from '@polkadot/types-support/metadata/static-kusama';
|
||||
|
||||
const registry = new TypeRegistry();
|
||||
const metadata = new Metadata(registry, metadataStatic);
|
||||
|
||||
registry.setMetadata(metadata);
|
||||
|
||||
describe('correct types', (): void => {
|
||||
it('correctly creates XcmV2TraitsOutcome', (): void => {
|
||||
const test = registry.createType<XcmV2TraitsOutcome>('XcmV2TraitsOutcome', {
|
||||
Incomplete: [3_000_000_000, 'BadOrigin']
|
||||
});
|
||||
|
||||
expect(test.toHuman()).toEqual({
|
||||
Incomplete: [
|
||||
'3,000,000,000',
|
||||
'BadOrigin'
|
||||
]
|
||||
});
|
||||
expect(test.isIncomplete).toEqual(true);
|
||||
expect(test.asIncomplete.toHuman()).toEqual([
|
||||
'3,000,000,000',
|
||||
'BadOrigin'
|
||||
]);
|
||||
});
|
||||
|
||||
it('correctly creates PolkadotRuntimeParachainsUmpPalletEvent', (): void => {
|
||||
const test = registry.createType<PolkadotRuntimeParachainsUmpPalletEvent>('PolkadotRuntimeParachainsUmpPalletEvent', '0x02112233445566778811223344556677881122334455667788112233445566778801005ed0b20000000006');
|
||||
|
||||
expect(test.asExecutedUpward[1].asIncomplete.toHuman()).toEqual([
|
||||
'3,000,000,000',
|
||||
'BadOrigin'
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -6,6 +6,7 @@
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"exclude": [
|
||||
"**/*.spec.ts",
|
||||
"**/kusama/*.ts",
|
||||
"**/polkadot/*.ts"
|
||||
],
|
||||
@@ -14,6 +15,7 @@
|
||||
{ "path": "../rpc-augment/tsconfig.build.json" },
|
||||
{ "path": "../types/tsconfig.build.json" },
|
||||
{ "path": "../types-codec/tsconfig.build.json" },
|
||||
{ "path": "../types-augment/tsconfig.build.json" }
|
||||
{ "path": "../types-augment/tsconfig.build.json" },
|
||||
{ "path": "../types-support/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
"**/base.ts",
|
||||
"**/kusama/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"**/kusama/*.spec.ts"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../api-base/tsconfig.build.json" },
|
||||
{ "path": "../rpc-augment/tsconfig.build.json" },
|
||||
|
||||
22
packages/api-augment/tsconfig.kusama.spec.json
Normal file
22
packages/api-augment/tsconfig.kusama.spec.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "..",
|
||||
"outDir": "./build",
|
||||
"rootDir": "./src",
|
||||
"emitDeclarationOnly": false,
|
||||
"noEmit": true
|
||||
},
|
||||
"include": [
|
||||
"**/kusama/*.spec.ts"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../api-augment/tsconfig.build.json" },
|
||||
{ "path": "../api-augment/tsconfig.kusama.json" },
|
||||
{ "path": "../api-base/tsconfig.build.json" },
|
||||
{ "path": "../rpc-augment/tsconfig.build.json" },
|
||||
{ "path": "../types/tsconfig.build.json" },
|
||||
{ "path": "../types-augment/tsconfig.build.json" },
|
||||
{ "path": "../types-support/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
@@ -9,6 +9,9 @@
|
||||
"**/base.ts",
|
||||
"**/polkadot/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"**/polkadot/*.spec.ts"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../api-base/tsconfig.build.json" },
|
||||
{ "path": "../rpc-augment/tsconfig.build.json" },
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
{ "path": "./packages/api/tsconfig.spec.json" },
|
||||
{ "path": "./packages/api-augment/tsconfig.build.json" },
|
||||
{ "path": "./packages/api-augment/tsconfig.kusama.json" },
|
||||
{ "path": "./packages/api-augment/tsconfig.kusama.spec.json" },
|
||||
{ "path": "./packages/api-augment/tsconfig.polkadot.json" },
|
||||
{ "path": "./packages/api-base/tsconfig.build.json" },
|
||||
{ "path": "./packages/api-contract/tsconfig.build.json" },
|
||||
|
||||
Reference in New Issue
Block a user