Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e45ff6d026 | ||
|
|
b49c2314e7 | ||
|
|
0ac085756a | ||
|
|
542a690c89 |
+2
-1
@@ -16,4 +16,5 @@
|
||||
3.7.2
|
||||
3.7.3
|
||||
3.9.2
|
||||
3.9.3
|
||||
3.9.3
|
||||
3.10.2
|
||||
@@ -1,5 +1,16 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 3.10.2 Feb 23, 2021
|
||||
|
||||
Upgrade priority: Medium. Recommended for users of chains where `MultiAddress` is in-use and blocks are decoded.
|
||||
|
||||
Changes:
|
||||
|
||||
- Fix decoding for `MultiAddress` enum where non-`AccountId` variable-lengths are provided as part of a stream
|
||||
- Added known Polkadot 28 upgrade block
|
||||
- Update for latest Substrate contracts `Schedule` types
|
||||
|
||||
|
||||
## 3.10.1 Feb 22, 2021
|
||||
|
||||
Upgrade priority: Low.
|
||||
|
||||
+1
-1
@@ -34,5 +34,5 @@
|
||||
"@types/jest": "^26.0.20",
|
||||
"copyfiles": "^2.4.1"
|
||||
},
|
||||
"version": "3.10.1"
|
||||
"version": "3.10.2"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/api-contract",
|
||||
"version": "3.10.1",
|
||||
"version": "3.10.2",
|
||||
"description": "Interfaces for interacting with contracts and contract ABIs",
|
||||
"main": "index.js",
|
||||
"sideEffects": false,
|
||||
@@ -13,8 +13,8 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.18",
|
||||
"@polkadot/api": "3.10.1",
|
||||
"@polkadot/types": "3.10.1",
|
||||
"@polkadot/api": "3.10.2",
|
||||
"@polkadot/types": "3.10.2",
|
||||
"@polkadot/util": "^5.7.1",
|
||||
"@polkadot/x-rxjs": "^5.7.1",
|
||||
"bn.js": "^4.11.9"
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-contract', version: '3.10.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-contract', version: '3.10.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/api-derive",
|
||||
"version": "3.10.1",
|
||||
"version": "3.10.2",
|
||||
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
|
||||
"main": "index.js",
|
||||
"sideEffects": false,
|
||||
@@ -13,9 +13,9 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.18",
|
||||
"@polkadot/api": "3.10.1",
|
||||
"@polkadot/rpc-core": "3.10.1",
|
||||
"@polkadot/types": "3.10.1",
|
||||
"@polkadot/api": "3.10.2",
|
||||
"@polkadot/rpc-core": "3.10.2",
|
||||
"@polkadot/types": "3.10.2",
|
||||
"@polkadot/util": "^5.7.1",
|
||||
"@polkadot/util-crypto": "^5.7.1",
|
||||
"@polkadot/x-rxjs": "^5.7.1",
|
||||
@@ -23,6 +23,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^5.7.1",
|
||||
"@polkadot/rpc-provider": "3.10.1"
|
||||
"@polkadot/rpc-provider": "3.10.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-derive', version: '3.10.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-derive', version: '3.10.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/api",
|
||||
"version": "3.10.1",
|
||||
"version": "3.10.2",
|
||||
"description": "Promise and RxJS wrappers around the Polkadot JS RPC",
|
||||
"main": "index.js",
|
||||
"sideEffects": [
|
||||
@@ -16,13 +16,13 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.18",
|
||||
"@polkadot/api-derive": "3.10.1",
|
||||
"@polkadot/api-derive": "3.10.2",
|
||||
"@polkadot/keyring": "^5.7.1",
|
||||
"@polkadot/metadata": "3.10.1",
|
||||
"@polkadot/rpc-core": "3.10.1",
|
||||
"@polkadot/rpc-provider": "3.10.1",
|
||||
"@polkadot/types": "3.10.1",
|
||||
"@polkadot/types-known": "3.10.1",
|
||||
"@polkadot/metadata": "3.10.2",
|
||||
"@polkadot/rpc-core": "3.10.2",
|
||||
"@polkadot/rpc-provider": "3.10.2",
|
||||
"@polkadot/types": "3.10.2",
|
||||
"@polkadot/types-known": "3.10.2",
|
||||
"@polkadot/util": "^5.7.1",
|
||||
"@polkadot/util-crypto": "^5.7.1",
|
||||
"@polkadot/x-rxjs": "^5.7.1",
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api', version: '3.10.1' };
|
||||
export const packageInfo = { name: '@polkadot/api', version: '3.10.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/metadata",
|
||||
"version": "3.10.1",
|
||||
"version": "3.10.2",
|
||||
"description": "Helpers to extract information from runtime metadata",
|
||||
"main": "index.js",
|
||||
"sideEffects": [
|
||||
@@ -16,8 +16,8 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.18",
|
||||
"@polkadot/types": "3.10.1",
|
||||
"@polkadot/types-known": "3.10.1",
|
||||
"@polkadot/types": "3.10.2",
|
||||
"@polkadot/types-known": "3.10.2",
|
||||
"@polkadot/util": "^5.7.1",
|
||||
"@polkadot/util-crypto": "^5.7.1",
|
||||
"bn.js": "^4.11.9"
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/metadata', version: '3.10.1' };
|
||||
export const packageInfo = { name: '@polkadot/metadata', version: '3.10.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/rpc-core",
|
||||
"version": "3.10.1",
|
||||
"version": "3.10.2",
|
||||
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
|
||||
"main": "index.js",
|
||||
"sideEffects": false,
|
||||
@@ -13,9 +13,9 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.18",
|
||||
"@polkadot/metadata": "3.10.1",
|
||||
"@polkadot/rpc-provider": "3.10.1",
|
||||
"@polkadot/types": "3.10.1",
|
||||
"@polkadot/metadata": "3.10.2",
|
||||
"@polkadot/rpc-provider": "3.10.2",
|
||||
"@polkadot/types": "3.10.2",
|
||||
"@polkadot/util": "^5.7.1",
|
||||
"@polkadot/x-rxjs": "^5.7.1"
|
||||
},
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', version: '3.10.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', version: '3.10.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/rpc-provider",
|
||||
"version": "3.10.1",
|
||||
"version": "3.10.2",
|
||||
"description": "Transport providers for the API",
|
||||
"main": "index.js",
|
||||
"sideEffects": false,
|
||||
@@ -13,7 +13,7 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.18",
|
||||
"@polkadot/types": "3.10.1",
|
||||
"@polkadot/types": "3.10.2",
|
||||
"@polkadot/util": "^5.7.1",
|
||||
"@polkadot/util-crypto": "^5.7.1",
|
||||
"@polkadot/x-fetch": "^5.7.1",
|
||||
@@ -24,7 +24,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^5.7.1",
|
||||
"@polkadot/metadata": "3.10.1",
|
||||
"@polkadot/metadata": "3.10.2",
|
||||
"mock-socket": "^9.0.3",
|
||||
"nock": "^13.0.7"
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', version: '3.10.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', version: '3.10.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/typegen",
|
||||
"version": "3.10.1",
|
||||
"version": "3.10.2",
|
||||
"description": "Type generation scripts",
|
||||
"main": "index.js",
|
||||
"sideEffects": false,
|
||||
@@ -22,10 +22,10 @@
|
||||
"@babel/core": "^7.12.17",
|
||||
"@babel/register": "^7.12.13",
|
||||
"@babel/runtime": "^7.12.18",
|
||||
"@polkadot/api": "3.10.1",
|
||||
"@polkadot/metadata": "3.10.1",
|
||||
"@polkadot/rpc-provider": "3.10.1",
|
||||
"@polkadot/types": "3.10.1",
|
||||
"@polkadot/api": "3.10.2",
|
||||
"@polkadot/metadata": "3.10.2",
|
||||
"@polkadot/rpc-provider": "3.10.2",
|
||||
"@polkadot/types": "3.10.2",
|
||||
"@polkadot/util": "^5.7.1",
|
||||
"handlebars": "^4.7.7",
|
||||
"websocket": "^1.0.33",
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/typegen', version: '3.10.1' };
|
||||
export const packageInfo = { name: '@polkadot/typegen', version: '3.10.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/types-known",
|
||||
"version": "3.10.1",
|
||||
"version": "3.10.2",
|
||||
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
|
||||
"main": "index.js",
|
||||
"sideEffects": false,
|
||||
@@ -14,7 +14,7 @@
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.18",
|
||||
"@polkadot/networks": "^5.7.1",
|
||||
"@polkadot/types": "3.10.1",
|
||||
"@polkadot/types": "3.10.2",
|
||||
"@polkadot/util": "^5.7.1",
|
||||
"bn.js": "^4.11.9"
|
||||
},
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-known', version: '3.10.1' };
|
||||
export const packageInfo = { name: '@polkadot/types-known', version: '3.10.2' };
|
||||
|
||||
@@ -8,7 +8,7 @@ const upgrades: ChainUpgradesRaw = [
|
||||
[244358, 8], [303079, 9], [314201, 10], [342400, 11], [443963, 12],
|
||||
[528470, 13], [687751, 14], [746085, 15], [787923, 16], [799302, 17],
|
||||
[1205128, 18], [1603423, 23], [1733218, 24], [2005673, 25], [2436698, 26],
|
||||
[3613564, 27]
|
||||
[3613564, 27], [3899547, 28]
|
||||
];
|
||||
|
||||
export default upgrades;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/types",
|
||||
"version": "3.10.1",
|
||||
"version": "3.10.2",
|
||||
"description": "Implementation of the Parity codec",
|
||||
"main": "index.js",
|
||||
"sideEffects": [
|
||||
@@ -16,7 +16,7 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.18",
|
||||
"@polkadot/metadata": "3.10.1",
|
||||
"@polkadot/metadata": "3.10.2",
|
||||
"@polkadot/util": "^5.7.1",
|
||||
"@polkadot/util-crypto": "^5.7.1",
|
||||
"@polkadot/x-rxjs": "^5.7.1",
|
||||
|
||||
@@ -14,7 +14,7 @@ import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
|
||||
import type { EthereumAddress, StatementKind } from '@polkadot/types/interfaces/claims';
|
||||
import type { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective';
|
||||
import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus';
|
||||
import type { AliveContractInfo, CodeHash, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractInfo, ContractStorageKey, DeletedContract, Gas, HostFnWeights, InstructionWeights, Limits, PrefabWasmModule, PrefabWasmModuleReserved, Schedule, ScheduleTo212, ScheduleTo258, SeedOf, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
|
||||
import type { AliveContractInfo, CodeHash, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractInfo, ContractStorageKey, DeletedContract, Gas, HostFnWeights, HostFnWeightsTo264, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, PrefabWasmModuleReserved, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
|
||||
import type { ContractConstructorSpec, ContractContractSpec, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpec, ContractEventSpec, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpec, ContractMessageSpec, ContractProject, ContractProjectContract, ContractProjectSource, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi';
|
||||
import type { DeployData, FundIndex, FundInfo, LastContribution } from '@polkadot/types/interfaces/crowdloan';
|
||||
import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
|
||||
@@ -438,6 +438,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<HeartbeatTo244>': Option<HeartbeatTo244>;
|
||||
'Option<HostConfiguration>': Option<HostConfiguration>;
|
||||
'Option<HostFnWeights>': Option<HostFnWeights>;
|
||||
'Option<HostFnWeightsTo264>': Option<HostFnWeightsTo264>;
|
||||
'Option<HrmpChannel>': Option<HrmpChannel>;
|
||||
'Option<HrmpChannelId>': Option<HrmpChannelId>;
|
||||
'Option<HrmpOpenChannelRequest>': Option<HrmpOpenChannelRequest>;
|
||||
@@ -493,6 +494,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<LeasePeriod>': Option<LeasePeriod>;
|
||||
'Option<LeasePeriodOf>': Option<LeasePeriodOf>;
|
||||
'Option<Limits>': Option<Limits>;
|
||||
'Option<LimitsTo264>': Option<LimitsTo264>;
|
||||
'Option<LocalValidationData>': Option<LocalValidationData>;
|
||||
'Option<LockIdentifier>': Option<LockIdentifier>;
|
||||
'Option<LookupSource>': Option<LookupSource>;
|
||||
@@ -688,6 +690,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<SchedulePriority>': Option<SchedulePriority>;
|
||||
'Option<ScheduleTo212>': Option<ScheduleTo212>;
|
||||
'Option<ScheduleTo258>': Option<ScheduleTo258>;
|
||||
'Option<ScheduleTo264>': Option<ScheduleTo264>;
|
||||
'Option<Scheduling>': Option<Scheduling>;
|
||||
'Option<Seal>': Option<Seal>;
|
||||
'Option<SealV0>': Option<SealV0>;
|
||||
@@ -1166,6 +1169,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<HeartbeatTo244>': Vec<HeartbeatTo244>;
|
||||
'Vec<HostConfiguration>': Vec<HostConfiguration>;
|
||||
'Vec<HostFnWeights>': Vec<HostFnWeights>;
|
||||
'Vec<HostFnWeightsTo264>': Vec<HostFnWeightsTo264>;
|
||||
'Vec<HrmpChannel>': Vec<HrmpChannel>;
|
||||
'Vec<HrmpChannelId>': Vec<HrmpChannelId>;
|
||||
'Vec<HrmpOpenChannelRequest>': Vec<HrmpOpenChannelRequest>;
|
||||
@@ -1221,6 +1225,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<LeasePeriod>': Vec<LeasePeriod>;
|
||||
'Vec<LeasePeriodOf>': Vec<LeasePeriodOf>;
|
||||
'Vec<Limits>': Vec<Limits>;
|
||||
'Vec<LimitsTo264>': Vec<LimitsTo264>;
|
||||
'Vec<LocalValidationData>': Vec<LocalValidationData>;
|
||||
'Vec<LockIdentifier>': Vec<LockIdentifier>;
|
||||
'Vec<LookupSource>': Vec<LookupSource>;
|
||||
@@ -1416,6 +1421,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<SchedulePriority>': Vec<SchedulePriority>;
|
||||
'Vec<ScheduleTo212>': Vec<ScheduleTo212>;
|
||||
'Vec<ScheduleTo258>': Vec<ScheduleTo258>;
|
||||
'Vec<ScheduleTo264>': Vec<ScheduleTo264>;
|
||||
'Vec<Scheduling>': Vec<Scheduling>;
|
||||
'Vec<Seal>': Vec<Seal>;
|
||||
'Vec<SealV0>': Vec<SealV0>;
|
||||
@@ -1894,6 +1900,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
HeartbeatTo244: HeartbeatTo244;
|
||||
HostConfiguration: HostConfiguration;
|
||||
HostFnWeights: HostFnWeights;
|
||||
HostFnWeightsTo264: HostFnWeightsTo264;
|
||||
HrmpChannel: HrmpChannel;
|
||||
HrmpChannelId: HrmpChannelId;
|
||||
HrmpOpenChannelRequest: HrmpOpenChannelRequest;
|
||||
@@ -1949,6 +1956,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
LeasePeriod: LeasePeriod;
|
||||
LeasePeriodOf: LeasePeriodOf;
|
||||
Limits: Limits;
|
||||
LimitsTo264: LimitsTo264;
|
||||
LocalValidationData: LocalValidationData;
|
||||
LockIdentifier: LockIdentifier;
|
||||
LookupSource: LookupSource;
|
||||
@@ -2144,6 +2152,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
SchedulePriority: SchedulePriority;
|
||||
ScheduleTo212: ScheduleTo212;
|
||||
ScheduleTo258: ScheduleTo258;
|
||||
ScheduleTo264: ScheduleTo264;
|
||||
Scheduling: Scheduling;
|
||||
Seal: Seal;
|
||||
SealV0: SealV0;
|
||||
|
||||
@@ -28,7 +28,7 @@ describe('Call', (): void => {
|
||||
expect(
|
||||
new Call(registry, '0x0601').toU8a()
|
||||
).toEqual(
|
||||
new Uint8Array([6, 1, 1, 110, 7, 17, 0, 0, 0])
|
||||
new Uint8Array([6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
|
||||
); // balances.setBalance
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
|
||||
describe('MultiAddress', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
it('correctly decodes a stream with Address20', (): void => {
|
||||
const a = registry.createType('MultiAddress', '0x0467f89207abe6e1b093befd84a48f03313765929207009e292608');
|
||||
|
||||
expect(a.index).toEqual(4);
|
||||
expect(a.toString()).toEqual('0x67f89207abe6e1b093befd84a48f033137659292');
|
||||
});
|
||||
|
||||
it('correctly decodes an AccountId', (): void => {
|
||||
const a = registry.createType('MultiAddress', '0x0102030405060708010203040506070801020304050607080102030405060708');
|
||||
|
||||
expect(a.index).toEqual(0);
|
||||
expect(a.toString()).toEqual('5C62W7ELLAAfix9LYrcx5smtcffbhvThkM5x7xfMeYXCtGwF');
|
||||
});
|
||||
|
||||
it('correctly decodes an Address20', (): void => {
|
||||
const a = registry.createType('MultiAddress', '0x67f89207abe6e1b093befd84a48f033137659292');
|
||||
|
||||
expect(a.index).toEqual(4);
|
||||
expect(a.toString()).toEqual('0x67f89207abe6e1b093befd84a48f033137659292');
|
||||
});
|
||||
});
|
||||
@@ -10,14 +10,12 @@ import { Enum } from '../codec/Enum';
|
||||
import { GenericAccountId } from './AccountId';
|
||||
import { GenericAccountIndex } from './AccountIndex';
|
||||
|
||||
function decodeMultiU8a (registry: Registry, value?: unknown): unknown {
|
||||
function decodeMultiU8a (value?: unknown): unknown {
|
||||
if (isU8a(value) && value.length <= 32) {
|
||||
if (value.length === 32) {
|
||||
return { id: value };
|
||||
} else if (value.length === 20) {
|
||||
return { Address20: value };
|
||||
} else {
|
||||
return decodeMultiAny(registry, registry.createType('AccountIndex', value));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,10 +30,10 @@ function decodeMultiAny (registry: Registry, value?: unknown): unknown {
|
||||
} else if (value instanceof GenericAccountIndex || isNumber(value) || isBn(value)) {
|
||||
return { Index: registry.createType('Compact<AccountIndex>', value) };
|
||||
} else if (isString(value)) {
|
||||
return decodeMultiU8a(registry, decodeAddress(value.toString()));
|
||||
return decodeMultiU8a(decodeAddress(value.toString()));
|
||||
}
|
||||
|
||||
return decodeMultiU8a(registry, value);
|
||||
return decodeMultiU8a(value);
|
||||
}
|
||||
|
||||
export class GenericMultiAddress extends Enum {
|
||||
|
||||
@@ -141,7 +141,7 @@ export default {
|
||||
trieId: 'TrieId'
|
||||
},
|
||||
Gas: 'u64',
|
||||
HostFnWeights: {
|
||||
HostFnWeightsTo264: {
|
||||
caller: 'Weight',
|
||||
address: 'Weight',
|
||||
gasLeft: 'Weight',
|
||||
@@ -188,6 +188,58 @@ export default {
|
||||
hashBlake2128: 'Weight',
|
||||
hashBlake2128PerByte: 'Weight'
|
||||
},
|
||||
HostFnWeights: {
|
||||
caller: 'Weight',
|
||||
address: 'Weight',
|
||||
gasLeft: 'Weight',
|
||||
balance: 'Weight',
|
||||
valueTransferred: 'Weight',
|
||||
minimumBalance: 'Weight',
|
||||
tombstoneDeposit: 'Weight',
|
||||
rentAllowance: 'Weight',
|
||||
blockNumber: 'Weight',
|
||||
now: 'Weight',
|
||||
weightToFee: 'Weight',
|
||||
gas: 'Weight',
|
||||
input: 'Weight',
|
||||
inputPerByte: 'Weight',
|
||||
return: 'Weight',
|
||||
returnPerByte: 'Weight',
|
||||
terminate: 'Weight',
|
||||
terminatePerCodeByte: 'Weight',
|
||||
restoreTo: 'Weight',
|
||||
restoreToPerCallerCodeByte: 'Weight',
|
||||
restoreToPerTombstoneCodeByte: 'Weight',
|
||||
restoreToPerDelta: 'Weight',
|
||||
random: 'Weight',
|
||||
depositEvent: 'Weight',
|
||||
depositEventPerTopic: 'Weight',
|
||||
depositEventPerByte: 'Weight',
|
||||
setRentAllowance: 'Weight',
|
||||
setStorage: 'Weight',
|
||||
setStoragePerByte: 'Weight',
|
||||
clearStorage: 'Weight',
|
||||
getStorage: 'Weight',
|
||||
getStoragePerByte: 'Weight',
|
||||
transfer: 'Weight',
|
||||
call: 'Weight',
|
||||
callPerCodeByte: 'Weight',
|
||||
callTransferSurcharge: 'Weight',
|
||||
callPerInputByte: 'Weight',
|
||||
callPerOutputByte: 'Weight',
|
||||
instantiate: 'Weight',
|
||||
instantiatePerCodeByte: 'Weight',
|
||||
instantiatePerInputByte: 'Weight',
|
||||
instantiatePerOutputByte: 'Weight',
|
||||
hashSha2256: 'Weight',
|
||||
hashSha2256PerByte: 'Weight',
|
||||
hashKeccak256: 'Weight',
|
||||
hashKeccak256PerByte: 'Weight',
|
||||
hashBlake2256: 'Weight',
|
||||
hashBlake2256PerByte: 'Weight',
|
||||
hashBlake2128: 'Weight',
|
||||
hashBlake2128PerByte: 'Weight'
|
||||
},
|
||||
InstructionWeights: {
|
||||
i64const: 'u32',
|
||||
i64load: 'u32',
|
||||
@@ -241,7 +293,7 @@ export default {
|
||||
i64rotl: 'u32',
|
||||
i64rotr: 'u32'
|
||||
},
|
||||
Limits: {
|
||||
LimitsTo264: {
|
||||
eventTopics: 'u32',
|
||||
stackHeight: 'u32',
|
||||
globals: 'u32',
|
||||
@@ -252,6 +304,16 @@ export default {
|
||||
subjectLen: 'u32',
|
||||
codeSize: 'u32'
|
||||
},
|
||||
Limits: {
|
||||
eventTopics: 'u32',
|
||||
stackHeight: 'u32',
|
||||
globals: 'u32',
|
||||
parameters: 'u32',
|
||||
memoryPages: 'u32',
|
||||
tableSize: 'u32',
|
||||
brTableSize: 'u32',
|
||||
subjectLen: 'u32'
|
||||
},
|
||||
PrefabWasmModule: {
|
||||
scheduleVersion: 'Compact<u32>',
|
||||
initial: 'Compact<u32>',
|
||||
@@ -295,6 +357,13 @@ export default {
|
||||
enablePrintln: 'bool',
|
||||
maxSubjectLen: 'u32'
|
||||
},
|
||||
ScheduleTo264: {
|
||||
version: 'u32',
|
||||
enablePrintln: 'bool',
|
||||
limits: 'LimitsTo264',
|
||||
instructionWeights: 'InstructionWeights',
|
||||
hostFnWeights: 'HostFnWeightsTo264'
|
||||
},
|
||||
Schedule: {
|
||||
version: 'u32',
|
||||
enablePrintln: 'bool',
|
||||
|
||||
@@ -115,6 +115,60 @@ export interface Gas extends u64 {}
|
||||
|
||||
/** @name HostFnWeights */
|
||||
export interface HostFnWeights extends Struct {
|
||||
readonly caller: Weight;
|
||||
readonly address: Weight;
|
||||
readonly gasLeft: Weight;
|
||||
readonly balance: Weight;
|
||||
readonly valueTransferred: Weight;
|
||||
readonly minimumBalance: Weight;
|
||||
readonly tombstoneDeposit: Weight;
|
||||
readonly rentAllowance: Weight;
|
||||
readonly blockNumber: Weight;
|
||||
readonly now: Weight;
|
||||
readonly weightToFee: Weight;
|
||||
readonly gas: Weight;
|
||||
readonly input: Weight;
|
||||
readonly inputPerByte: Weight;
|
||||
readonly return: Weight;
|
||||
readonly returnPerByte: Weight;
|
||||
readonly terminate: Weight;
|
||||
readonly terminatePerCodeByte: Weight;
|
||||
readonly restoreTo: Weight;
|
||||
readonly restoreToPerCallerCodeByte: Weight;
|
||||
readonly restoreToPerTombstoneCodeByte: Weight;
|
||||
readonly restoreToPerDelta: Weight;
|
||||
readonly random: Weight;
|
||||
readonly depositEvent: Weight;
|
||||
readonly depositEventPerTopic: Weight;
|
||||
readonly depositEventPerByte: Weight;
|
||||
readonly setRentAllowance: Weight;
|
||||
readonly setStorage: Weight;
|
||||
readonly setStoragePerByte: Weight;
|
||||
readonly clearStorage: Weight;
|
||||
readonly getStorage: Weight;
|
||||
readonly getStoragePerByte: Weight;
|
||||
readonly transfer: Weight;
|
||||
readonly call: Weight;
|
||||
readonly callPerCodeByte: Weight;
|
||||
readonly callTransferSurcharge: Weight;
|
||||
readonly callPerInputByte: Weight;
|
||||
readonly callPerOutputByte: Weight;
|
||||
readonly instantiate: Weight;
|
||||
readonly instantiatePerCodeByte: Weight;
|
||||
readonly instantiatePerInputByte: Weight;
|
||||
readonly instantiatePerOutputByte: Weight;
|
||||
readonly hashSha2256: Weight;
|
||||
readonly hashSha2256PerByte: Weight;
|
||||
readonly hashKeccak256: Weight;
|
||||
readonly hashKeccak256PerByte: Weight;
|
||||
readonly hashBlake2256: Weight;
|
||||
readonly hashBlake2256PerByte: Weight;
|
||||
readonly hashBlake2128: Weight;
|
||||
readonly hashBlake2128PerByte: Weight;
|
||||
}
|
||||
|
||||
/** @name HostFnWeightsTo264 */
|
||||
export interface HostFnWeightsTo264 extends Struct {
|
||||
readonly caller: Weight;
|
||||
readonly address: Weight;
|
||||
readonly gasLeft: Weight;
|
||||
@@ -227,6 +281,18 @@ export interface Limits extends Struct {
|
||||
readonly tableSize: u32;
|
||||
readonly brTableSize: u32;
|
||||
readonly subjectLen: u32;
|
||||
}
|
||||
|
||||
/** @name LimitsTo264 */
|
||||
export interface LimitsTo264 extends Struct {
|
||||
readonly eventTopics: u32;
|
||||
readonly stackHeight: u32;
|
||||
readonly globals: u32;
|
||||
readonly parameters: u32;
|
||||
readonly memoryPages: u32;
|
||||
readonly tableSize: u32;
|
||||
readonly brTableSize: u32;
|
||||
readonly subjectLen: u32;
|
||||
readonly codeSize: u32;
|
||||
}
|
||||
|
||||
@@ -290,6 +356,15 @@ export interface ScheduleTo258 extends Struct {
|
||||
readonly maxSubjectLen: u32;
|
||||
}
|
||||
|
||||
/** @name ScheduleTo264 */
|
||||
export interface ScheduleTo264 extends Struct {
|
||||
readonly version: u32;
|
||||
readonly enablePrintln: bool;
|
||||
readonly limits: LimitsTo264;
|
||||
readonly instructionWeights: InstructionWeights;
|
||||
readonly hostFnWeights: HostFnWeightsTo264;
|
||||
}
|
||||
|
||||
/** @name SeedOf */
|
||||
export interface SeedOf extends Hash {}
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types', version: '3.10.1' };
|
||||
export const packageInfo = { name: '@polkadot/types', version: '3.10.2' };
|
||||
|
||||
@@ -1752,24 +1752,24 @@ __metadata:
|
||||
resolution: "@polkadot/api-contract@workspace:packages/api-contract"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.18
|
||||
"@polkadot/api": 3.10.1
|
||||
"@polkadot/types": 3.10.1
|
||||
"@polkadot/api": 3.10.2
|
||||
"@polkadot/types": 3.10.2
|
||||
"@polkadot/util": ^5.7.1
|
||||
"@polkadot/x-rxjs": ^5.7.1
|
||||
bn.js: ^4.11.9
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/api-derive@3.10.1, @polkadot/api-derive@workspace:packages/api-derive":
|
||||
"@polkadot/api-derive@3.10.2, @polkadot/api-derive@workspace:packages/api-derive":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/api-derive@workspace:packages/api-derive"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.18
|
||||
"@polkadot/api": 3.10.1
|
||||
"@polkadot/api": 3.10.2
|
||||
"@polkadot/keyring": ^5.7.1
|
||||
"@polkadot/rpc-core": 3.10.1
|
||||
"@polkadot/rpc-provider": 3.10.1
|
||||
"@polkadot/types": 3.10.1
|
||||
"@polkadot/rpc-core": 3.10.2
|
||||
"@polkadot/rpc-provider": 3.10.2
|
||||
"@polkadot/types": 3.10.2
|
||||
"@polkadot/util": ^5.7.1
|
||||
"@polkadot/util-crypto": ^5.7.1
|
||||
"@polkadot/x-rxjs": ^5.7.1
|
||||
@@ -1777,18 +1777,18 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/api@3.10.1, @polkadot/api@workspace:packages/api":
|
||||
"@polkadot/api@3.10.2, @polkadot/api@workspace:packages/api":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/api@workspace:packages/api"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.18
|
||||
"@polkadot/api-derive": 3.10.1
|
||||
"@polkadot/api-derive": 3.10.2
|
||||
"@polkadot/keyring": ^5.7.1
|
||||
"@polkadot/metadata": 3.10.1
|
||||
"@polkadot/rpc-core": 3.10.1
|
||||
"@polkadot/rpc-provider": 3.10.1
|
||||
"@polkadot/types": 3.10.1
|
||||
"@polkadot/types-known": 3.10.1
|
||||
"@polkadot/metadata": 3.10.2
|
||||
"@polkadot/rpc-core": 3.10.2
|
||||
"@polkadot/rpc-provider": 3.10.2
|
||||
"@polkadot/types": 3.10.2
|
||||
"@polkadot/types-known": 3.10.2
|
||||
"@polkadot/util": ^5.7.1
|
||||
"@polkadot/util-crypto": ^5.7.1
|
||||
"@polkadot/x-rxjs": ^5.7.1
|
||||
@@ -1902,14 +1902,14 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/metadata@3.10.1, @polkadot/metadata@workspace:packages/metadata":
|
||||
"@polkadot/metadata@3.10.2, @polkadot/metadata@workspace:packages/metadata":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/metadata@workspace:packages/metadata"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.18
|
||||
"@polkadot/keyring": ^5.7.1
|
||||
"@polkadot/types": 3.10.1
|
||||
"@polkadot/types-known": 3.10.1
|
||||
"@polkadot/types": 3.10.2
|
||||
"@polkadot/types-known": 3.10.2
|
||||
"@polkadot/util": ^5.7.1
|
||||
"@polkadot/util-crypto": ^5.7.1
|
||||
bn.js: ^4.11.9
|
||||
@@ -1925,28 +1925,28 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/rpc-core@3.10.1, @polkadot/rpc-core@workspace:packages/rpc-core":
|
||||
"@polkadot/rpc-core@3.10.2, @polkadot/rpc-core@workspace:packages/rpc-core":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/rpc-core@workspace:packages/rpc-core"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.18
|
||||
"@polkadot/keyring": ^5.7.1
|
||||
"@polkadot/metadata": 3.10.1
|
||||
"@polkadot/rpc-provider": 3.10.1
|
||||
"@polkadot/types": 3.10.1
|
||||
"@polkadot/metadata": 3.10.2
|
||||
"@polkadot/rpc-provider": 3.10.2
|
||||
"@polkadot/types": 3.10.2
|
||||
"@polkadot/util": ^5.7.1
|
||||
"@polkadot/x-rxjs": ^5.7.1
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/rpc-provider@3.10.1, @polkadot/rpc-provider@workspace:packages/rpc-provider":
|
||||
"@polkadot/rpc-provider@3.10.2, @polkadot/rpc-provider@workspace:packages/rpc-provider":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/rpc-provider@workspace:packages/rpc-provider"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.18
|
||||
"@polkadot/keyring": ^5.7.1
|
||||
"@polkadot/metadata": 3.10.1
|
||||
"@polkadot/types": 3.10.1
|
||||
"@polkadot/metadata": 3.10.2
|
||||
"@polkadot/types": 3.10.2
|
||||
"@polkadot/util": ^5.7.1
|
||||
"@polkadot/util-crypto": ^5.7.1
|
||||
"@polkadot/x-fetch": ^5.7.1
|
||||
@@ -1975,10 +1975,10 @@ __metadata:
|
||||
"@babel/core": ^7.12.17
|
||||
"@babel/register": ^7.12.13
|
||||
"@babel/runtime": ^7.12.18
|
||||
"@polkadot/api": 3.10.1
|
||||
"@polkadot/metadata": 3.10.1
|
||||
"@polkadot/rpc-provider": 3.10.1
|
||||
"@polkadot/types": 3.10.1
|
||||
"@polkadot/api": 3.10.2
|
||||
"@polkadot/metadata": 3.10.2
|
||||
"@polkadot/rpc-provider": 3.10.2
|
||||
"@polkadot/types": 3.10.2
|
||||
"@polkadot/util": ^5.7.1
|
||||
"@types/websocket": ^1.0.1
|
||||
"@types/yargs": ^16.0.0
|
||||
@@ -1994,26 +1994,26 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/types-known@3.10.1, @polkadot/types-known@workspace:packages/types-known":
|
||||
"@polkadot/types-known@3.10.2, @polkadot/types-known@workspace:packages/types-known":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/types-known@workspace:packages/types-known"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.18
|
||||
"@polkadot/networks": ^5.7.1
|
||||
"@polkadot/types": 3.10.1
|
||||
"@polkadot/types": 3.10.2
|
||||
"@polkadot/util": ^5.7.1
|
||||
"@types/bn.js": ^4.11.6
|
||||
bn.js: ^4.11.9
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/types@3.10.1, @polkadot/types@workspace:packages/types":
|
||||
"@polkadot/types@3.10.2, @polkadot/types@workspace:packages/types":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/types@workspace:packages/types"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.18
|
||||
"@polkadot/keyring": ^5.7.1
|
||||
"@polkadot/metadata": 3.10.1
|
||||
"@polkadot/metadata": 3.10.2
|
||||
"@polkadot/util": ^5.7.1
|
||||
"@polkadot/util-crypto": ^5.7.1
|
||||
"@polkadot/x-rxjs": ^5.7.1
|
||||
|
||||
Reference in New Issue
Block a user