Explicit deprecation logging (#979)

* Explicit deprecation logging

* Update CHANGELOG.md
This commit is contained in:
Jaco
2021-05-12 14:25:01 +02:00
committed by GitHub
parent bd047063ef
commit d63d92e488
4 changed files with 10 additions and 2 deletions
+1
View File
@@ -11,6 +11,7 @@ Changes:
- Added additional double-byte ss58 tests
- Aligned ss58 registry with Substrate
- Add explicit log for deprecation of `setSS58Format`
## 6.3.1 Apr 25, 2021
+1 -1
View File
@@ -56,7 +56,7 @@ export const knownLedger: KnownLedger = {
polymesh: 0x00000253
};
// testenets should not allow selection
// testnets should not allow selection
export const knownTestnet: KnownTestnet = {
'dock-testnet': true,
jupiter: true,
@@ -3,12 +3,18 @@
import type { Prefix } from './types';
import { logger } from '@polkadot/util';
import { defaults } from './defaults';
const l = logger('setSS58Format');
/**
* @description Sets the global SS58 format to use for address encoding
* @deprecated Use keyring.setSS58Format
*/
export function setSS58Format (prefix: Prefix): void {
l.warn('Global setting of the ss58Format is deprecated and not recommended. Set format on the keyring (if used) or as pat of the address encode function');
defaults.prefix = prefix;
}
+2 -1
View File
@@ -22,6 +22,7 @@ import { isUndefined } from '../is/undefined';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function arrayFilter <T = any> (array: T[], allowNulls = true): T[] {
return array.filter((value) =>
!isUndefined(value) && (allowNulls || !isNull(value))
!isUndefined(value) &&
(allowNulls || !isNull(value))
);
}