Explicit deprecation logging (#979)
* Explicit deprecation logging * Update CHANGELOG.md
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user