Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@babel/core": "^7.12.9",
"@babel/register": "^7.12.1",
"@babel/runtime": "^7.12.5",
"@polkadot/dev": "^0.60.12",
"@polkadot/dev": "^0.60.13",
"@polkadot/ts": "^0.3.57",
"@polkadot/typegen": "workspace:packages/typegen",
"@types/jest": "^26.0.17",
Expand Down
36 changes: 6 additions & 30 deletions packages/metadata/src/v12/static-substrate.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
"name": "BlockWeight",
"modifier": "Default",
"type": {
"Plain": "ExtrinsicsWeight"
"Plain": "ConsumedWeight"
},
"fallback": "0x00000000000000000000000000000000",
"fallback": "0x000000000000000000000000000000000000000000000000",
"documentation": [
" The current weight for the block."
]
Expand Down Expand Up @@ -462,14 +462,6 @@
" The maximum number of blocks to allow in mortal eras."
]
},
{
"name": "MaximumBlockWeight",
"type": "Weight",
"value": "0x00204aa9d1010000",
"documentation": [
" The maximum weight of a block."
]
},
Comment on lines -465 to -472
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks a couple of things, both in the API and the apps UI.

{
"name": "DbWeight",
"type": "RuntimeDbWeight",
Expand All @@ -479,27 +471,11 @@
]
},
{
"name": "BlockExecutionWeight",
"type": "Weight",
"value": "0x00f2052a01000000",
"documentation": [
" The base weight of executing a block, independent of the transactions in the block."
]
},
{
"name": "ExtrinsicBaseWeight",
"type": "Weight",
"value": "0x4059730700000000",
"documentation": [
" The base weight of an Extrinsic in the block, independent of the of extrinsic being executed."
]
},
{
"name": "MaximumBlockLength",
"type": "u32",
"value": "0x00005000",
"name": "BlockWeights",
"type": "BlockWeights",
"value": "0x00f2052a0100000000204aa9d1010000405973070000000001c06e96a62e010000010098f73e5d010000010000000000000000405973070000000001c0f6e810a30100000100204aa9d1010000010088526a740000004059730700000000000000",
"documentation": [
" The maximum length of a block (in bytes)."
" The weight configuration (limits & base values) for each class of extrinsics and block."
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion packages/metadata/src/v12/static.ts

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion packages/types/src/augment/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, Vouching
import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactScore, CompactScoreCompact, ElectionCompute, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RewardDestination, RewardDestinationTo257, RewardPoint, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196 } from '@polkadot/types/interfaces/staking';
import type { ApiId, KeyValueOption, ReadProof, RuntimeVersion, RuntimeVersionApi, StorageChangeSet } from '@polkadot/types/interfaces/state';
import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support';
import type { AccountInfo, ApplyExtrinsicResult, ChainProperties, ChainType, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TransactionValidityError, UnknownTransaction } from '@polkadot/types/interfaces/system';
import type { AccountInfo, ApplyExtrinsicResult, BlockWeights, ChainProperties, ChainType, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TransactionValidityError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system';
import type { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatusCuratorProposed, BountyStatusPendingPayout, OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury';
import type { Multiplier } from '@polkadot/types/interfaces/txpayment';
import type { Multisig, Timepoint } from '@polkadot/types/interfaces/utility';
Expand Down Expand Up @@ -1167,6 +1167,15 @@ declare module '@polkadot/types/types/registry' {
ApplyExtrinsicResult: ApplyExtrinsicResult;
'Option<ApplyExtrinsicResult>': Option<ApplyExtrinsicResult>;
'Vec<ApplyExtrinsicResult>': Vec<ApplyExtrinsicResult>;
WeightPerClass: WeightPerClass;
'Option<WeightPerClass>': Option<WeightPerClass>;
'Vec<WeightPerClass>': Vec<WeightPerClass>;
PerDispatchClass: PerDispatchClass;
'Option<PerDispatchClass>': Option<PerDispatchClass>;
'Vec<PerDispatchClass>': Vec<PerDispatchClass>;
BlockWeights: BlockWeights;
'Option<BlockWeights>': Option<BlockWeights>;
'Vec<BlockWeights>': Vec<BlockWeights>;
ChainProperties: ChainProperties;
'Option<ChainProperties>': Option<ChainProperties>;
'Vec<ChainProperties>': Vec<ChainProperties>;
Expand Down
17 changes: 17 additions & 0 deletions packages/types/src/interfaces/system/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ export default {
data: 'AccountData'
},
ApplyExtrinsicResult: 'Result<DispatchOutcome, TransactionValidityError>',
BlockWeights: {
baseBlock: 'Weight',
maxBlock: 'Weight',
perClass: 'PerDispatchClass'
},
ChainProperties: {
ss58Format: 'Option<u8>',
tokenDecimals: 'Option<u32>',
Expand All @@ -152,6 +157,7 @@ export default {
Custom: 'Text'
}
},
ConsumedWeight: 'PerDispatchClass',
DigestOf: 'Digest',
DispatchClass: {
_enum: ['Normal', 'Operational', 'Mandatory']
Expand Down Expand Up @@ -283,6 +289,11 @@ export default {
bestHash: 'Hash',
bestNumber: 'BlockNumber'
},
PerDispatchClass: {
normal: 'WeightPerClass',
operational: 'WeightPerClass',
mandatory: 'WeightPerClass'
},
Phase: {
_enum: {
ApplyExtrinsic: 'u32',
Expand Down Expand Up @@ -317,6 +328,12 @@ export default {
NoUnsignedValidator: 'Null',
Custom: 'u8'
}
},
WeightPerClass: {
baseExtrinsic: 'Weight',
maxExtrinsic: 'Weight',
maxTotal: 'Option<Weight>',
reserved: 'Option<Weight>'
}
}
} as Definitions;
22 changes: 22 additions & 0 deletions packages/types/src/interfaces/system/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ export interface ApplyExtrinsicResult extends Result<DispatchOutcome, Transactio
readonly asOk: DispatchOutcome;
}

/** @name BlockWeights */
export interface BlockWeights extends Struct {
readonly baseBlock: Weight;
readonly maxBlock: Weight;
readonly perClass: PerDispatchClass;
}

/** @name ChainProperties */
export interface ChainProperties extends Struct {
readonly ss58Format: Option<u8>;
Expand Down Expand Up @@ -238,6 +245,13 @@ export interface PeerPing extends Struct {
readonly secs: u64;
}

/** @name PerDispatchClass */
export interface PerDispatchClass extends Struct {
readonly normal: WeightPerClass;
readonly operational: WeightPerClass;
readonly mandatory: WeightPerClass;
}

/** @name Phase */
export interface Phase extends Enum {
readonly isApplyExtrinsic: boolean;
Expand Down Expand Up @@ -286,4 +300,12 @@ export interface UnknownTransaction extends Enum {
readonly asCustom: u8;
}

/** @name WeightPerClass */
export interface WeightPerClass extends Struct {
readonly baseExtrinsic: Weight;
readonly maxExtrinsic: Weight;
readonly maxTotal: Option<Weight>;
readonly reserved: Option<Weight>;
}

export type PHANTOM_SYSTEM = 'system';
4 changes: 3 additions & 1 deletion packages/types/src/types/extrinsic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
import { ExtrinsicStatus } from '../interfaces/author';
import { EcdsaSignature, Ed25519Signature, Sr25519Signature } from '../interfaces/extrinsics';
import { Address, Balance, Call, H256, Index } from '../interfaces/runtime';
import { EventRecord } from '../interfaces/system';
import { DispatchError, DispatchInfo, EventRecord } from '../interfaces/system';
import { Codec } from './codec';
import { AnyJson, AnyNumber, AnyU8a } from './helpers';
import { ICompact, IKeyringPair, IMethod, IRuntimeVersion } from './interfaces';

export interface ISubmittableResult {
readonly dispatchError: DispatchError;
readonly dispatchInfo: DispatchInfo;
readonly events: EventRecord[];
readonly status: ExtrinsicStatus;
readonly isCompleted: boolean;
Expand Down
27 changes: 6 additions & 21 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1763,9 +1763,9 @@ __metadata:
languageName: unknown
linkType: soft

"@polkadot/dev@npm:^0.60.12":
version: 0.60.12
resolution: "@polkadot/dev@npm:0.60.12"
"@polkadot/dev@npm:^0.60.13":
version: 0.60.13
resolution: "@polkadot/dev@npm:0.60.13"
dependencies:
"@babel/cli": ^7.12.8
"@babel/core": ^7.12.9
Expand Down Expand Up @@ -1852,7 +1852,7 @@ __metadata:
polkadot-exec-typedoc: scripts/polkadot-exec-typedoc.cjs
polkadot-exec-vuepress: scripts/polkadot-exec-vuepress.cjs
polkadot-exec-webpack: scripts/polkadot-exec-webpack.cjs
checksum: 13f7153ccc62fc62c4823946175845f8c6b50b1e20e9321ce607ea23a0b8b39f3359e707997a62ce31a44c6ea8b9a134b206e3aecd970ff9c3b040d3cd79f06e
checksum: 9df7ab2952be5d943ab5db9d04379f2f1b1f56e89c16843417952ad081b3f9c341a338549c8147751507654d51b80d6144e737a326ae17a0feba307ecae46ff3
languageName: node
linkType: hard

Expand Down Expand Up @@ -9255,7 +9255,7 @@ fsevents@~2.1.2:
"@babel/core": ^7.12.9
"@babel/register": ^7.12.1
"@babel/runtime": ^7.12.5
"@polkadot/dev": ^0.60.12
"@polkadot/dev": ^0.60.13
"@polkadot/ts": ^0.3.57
"@polkadot/typegen": "workspace:packages/typegen"
"@types/jest": ^26.0.17
Expand Down Expand Up @@ -11082,22 +11082,7 @@ fsevents@~2.1.2:
languageName: node
linkType: hard

"yargs@npm:^16.0.3, yargs@npm:^16.1.0":
version: 16.1.1
resolution: "yargs@npm:16.1.1"
dependencies:
cliui: ^7.0.2
escalade: ^3.1.1
get-caller-file: ^2.0.5
require-directory: ^2.1.1
string-width: ^4.2.0
y18n: ^5.0.5
yargs-parser: ^20.2.2
checksum: f88462770b6d65107b7295bdd68c38bc3cba9ab0362df476f44c5f6770ee2f39f48bca9813e8a9dc792a15f93e051a7e37346c0f66cf0ec35c63869963c43e0c
languageName: node
linkType: hard

"yargs@npm:^16.2.0":
"yargs@npm:^16.0.3, yargs@npm:^16.1.0, yargs@npm:^16.2.0":
version: 16.2.0
resolution: "yargs@npm:16.2.0"
dependencies:
Expand Down