Remove support for pre-v2 staking (#2980)
* Remove support for pre-v2 staking * Adjust with util array functions * Remove old enumset support * Empty controller * withController flag
This commit is contained in:
@@ -18,13 +18,13 @@
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"@polkadot/metadata": "3.1.2-6",
|
||||
"@polkadot/util": "^5.1.1",
|
||||
"@polkadot/util-crypto": "^5.1.1",
|
||||
"@polkadot/util": "^5.1.2-1",
|
||||
"@polkadot/util-crypto": "^5.1.2-1",
|
||||
"@polkadot/x-rxjs": "3.1.2-6",
|
||||
"@types/bn.js": "^4.11.6",
|
||||
"bn.js": "^4.11.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^5.1.1"
|
||||
"@polkadot/keyring": "^5.1.2-1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
import type { Codec, Constructor, Registry } from '../../types';
|
||||
|
||||
import { arrayFlatten } from '@polkadot/util';
|
||||
|
||||
/**
|
||||
* Given an u8a, and an array of Type constructors, decode the u8a against the
|
||||
* types, and return an array of decoded values.
|
||||
@@ -22,5 +24,5 @@ export function decodeU8a (registry: Registry, u8a: Uint8Array, _types: Construc
|
||||
const Type = types[0];
|
||||
const value = new Type(registry, u8a);
|
||||
|
||||
return [value].concat(decodeU8a(registry, u8a.subarray(value.encodedLength), types.slice(1)));
|
||||
return arrayFlatten([[value], decodeU8a(registry, u8a.subarray(value.encodedLength), types.slice(1))]);
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ import { decodeAddress, encodeAddress } from '@polkadot/util-crypto';
|
||||
|
||||
import { u32 } from '../primitive/U32';
|
||||
|
||||
export const ENUMSET_SIZE = new BN(64);
|
||||
|
||||
const PREFIX_1BYTE = 0xef;
|
||||
const PREFIX_2BYTE = 0xfc;
|
||||
const PREFIX_4BYTE = 0xfd;
|
||||
|
||||
Reference in New Issue
Block a user