diff --git a/packages/types-known/src/chain/index.ts b/packages/types-known/src/chain/index.ts index 408790c98c..d49039e74f 100644 --- a/packages/types-known/src/chain/index.ts +++ b/packages/types-known/src/chain/index.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/types authors & contributors +// Copyright 2017-2020 @polkadot/types-known authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/types-known/src/index.spec.ts b/packages/types-known/src/index.spec.ts index a0e1d38460..c056dc49f6 100644 --- a/packages/types-known/src/index.spec.ts +++ b/packages/types-known/src/index.spec.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/types authors & contributors +// Copyright 2017-2020 @polkadot/types-known authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/types-known/src/index.ts b/packages/types-known/src/index.ts index d244be35ee..79ff0e4830 100644 --- a/packages/types-known/src/index.ts +++ b/packages/types-known/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/types authors & contributors +// Copyright 2017-2020 @polkadot/types-known authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. @@ -12,6 +12,7 @@ import typesChain from './chain'; import typesMeta from './metadata'; import typesModules from './modules'; import typesSpec from './spec'; +import warnings from './warnings'; // flatten a VersionedType[] into a Record /** @internal */ @@ -52,6 +53,8 @@ export function getSpecTypes ({ knownTypes }: Registry, chainName: Text | string const _specName = specName.toString(); const _specVersion = bnToBn(specVersion).toNumber(); + (warnings[_specName] || []).forEach((warning) => console.warn(`*** ${warning}`)); + return { ...filterVersions(typesSpec[_specName], _specVersion), ...filterVersions(typesChain[_chainName], _specVersion), diff --git a/packages/types-known/src/metadata.ts b/packages/types-known/src/metadata.ts index 249f43bb72..5542619529 100644 --- a/packages/types-known/src/metadata.ts +++ b/packages/types-known/src/metadata.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/types authors & contributors +// Copyright 2017-2020 @polkadot/types-known authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/types-known/src/modules.ts b/packages/types-known/src/modules.ts index 2e022d64fc..29448f98ec 100644 --- a/packages/types-known/src/modules.ts +++ b/packages/types-known/src/modules.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/types authors & contributors +// Copyright 2017-2020 @polkadot/types-known authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/types-known/src/spec/centrifuge-chain.ts b/packages/types-known/src/spec/centrifuge-chain.ts index 85b8021cde..de64be7211 100644 --- a/packages/types-known/src/spec/centrifuge-chain.ts +++ b/packages/types-known/src/spec/centrifuge-chain.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/types authors & contributors +// Copyright 2017-2020 @polkadot/types-known authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/types-known/src/spec/index.ts b/packages/types-known/src/spec/index.ts index 43f841de82..d258b31a8d 100644 --- a/packages/types-known/src/spec/index.ts +++ b/packages/types-known/src/spec/index.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/types authors & contributors +// Copyright 2017-2020 @polkadot/types-known authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/types-known/src/spec/kusama.ts b/packages/types-known/src/spec/kusama.ts index e602ce34fc..976d48e273 100644 --- a/packages/types-known/src/spec/kusama.ts +++ b/packages/types-known/src/spec/kusama.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/types authors & contributors +// Copyright 2017-2020 @polkadot/types-known authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/types-known/src/spec/polkadot.ts b/packages/types-known/src/spec/polkadot.ts index 636ce01128..59260ba537 100644 --- a/packages/types-known/src/spec/polkadot.ts +++ b/packages/types-known/src/spec/polkadot.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/types authors & contributors +// Copyright 2017-2020 @polkadot/types-known authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/types-known/src/spec/westend.ts b/packages/types-known/src/spec/westend.ts index 23415197d6..3e47f51a6c 100644 --- a/packages/types-known/src/spec/westend.ts +++ b/packages/types-known/src/spec/westend.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/types authors & contributors +// Copyright 2017-2020 @polkadot/types-known authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/types-known/src/warnings.ts b/packages/types-known/src/warnings.ts new file mode 100644 index 0000000000..435bd9faad --- /dev/null +++ b/packages/types-known/src/warnings.ts @@ -0,0 +1,18 @@ +// Copyright 2017-2020 @polkadot/types-known authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +// Type overrides for specific spec types & versions as given in runtimeVersion +const warnings: Record = { + 'node-template': [ + '', + 'You are using the node-template, depending on your config and age of the template, you may', + 'have some unexpected results without applying the correct config for your node type:', + '', + '- If you have trouble sending txs, apply https://polkadot.js.org/api/start/FAQ.html#i-cannot-send-transactions-from-my-node-template-based-chain', + '- If you have trouble parsing events, apply https://polkadot.js.org/api/start/FAQ.html#using-a-non-current-master-node-i-have-issues-parsing-events', + '' + ] +}; + +export default warnings;