diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a8d88843a..1555848416 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 1.21.0-beta.x +- Add support for `CheckMortality` signed extension (old `CheckEra` is now an alias) - Fix subscriptions never unsubscribing after the id type swap in 1.18.1 - Promise API will default to using `getStorage` on non-subscription calls, reducing RPC overhead - Optimize derive BN allocations, using in-place operators as applicable diff --git a/packages/types/src/extrinsic/signedExtensions/emptyCheck.ts b/packages/types/src/extrinsic/signedExtensions/emptyCheck.ts new file mode 100644 index 0000000000..5896ad6b5e --- /dev/null +++ b/packages/types/src/extrinsic/signedExtensions/emptyCheck.ts @@ -0,0 +1,8 @@ +// Copyright 2017-2020 @polkadot/types authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +export default { + extra: {}, + types: {} +}; diff --git a/packages/types/src/extrinsic/signedExtensions/polkadot.ts b/packages/types/src/extrinsic/signedExtensions/polkadot.ts index d077f008f7..cf1c3bedb8 100644 --- a/packages/types/src/extrinsic/signedExtensions/polkadot.ts +++ b/packages/types/src/extrinsic/signedExtensions/polkadot.ts @@ -4,29 +4,13 @@ import { ExtDef } from './types'; +import EmptyCheck from './emptyCheck'; + export default { - LimitParathreadCommits: { - extra: {}, - types: {} - }, - OnlyStakingAndClaims: { - extra: {}, - types: {} - }, - PrevalidateAttests: { - extra: {}, - types: {} - }, - RestrictFunctionality: { - extra: {}, - types: {} - }, - TransactionCallFilter: { - extra: {}, - types: {} - }, - ValidateDoubleVoteReports: { - extra: {}, - types: {} - } + LimitParathreadCommits: EmptyCheck, + OnlyStakingAndClaims: EmptyCheck, + PrevalidateAttests: EmptyCheck, + RestrictFunctionality: EmptyCheck, + TransactionCallFilter: EmptyCheck, + ValidateDoubleVoteReports: EmptyCheck } as ExtDef; diff --git a/packages/types/src/extrinsic/signedExtensions/substrate.ts b/packages/types/src/extrinsic/signedExtensions/substrate.ts index 7574c14b63..6fa9015d9c 100644 --- a/packages/types/src/extrinsic/signedExtensions/substrate.ts +++ b/packages/types/src/extrinsic/signedExtensions/substrate.ts @@ -4,6 +4,17 @@ import { ExtDef } from './types'; +import EmptyCheck from './emptyCheck'; + +const CheckMortality = { + extra: { + blockHash: 'Hash' + }, + types: { + era: 'ExtrinsicEra' + } +}; + export default { ChargeTransactionPayment: { extra: {}, @@ -11,24 +22,15 @@ export default { tip: 'Compact' } }, - CheckBlockGasLimit: { - extra: {}, - types: {} - }, - CheckEra: { - extra: { - blockHash: 'Hash' - }, - types: { - era: 'ExtrinsicEra' - } - }, + CheckBlockGasLimit: EmptyCheck, + CheckEra: CheckMortality, CheckGenesis: { extra: { genesisHash: 'Hash' }, types: {} }, + CheckMortality, CheckNonce: { extra: {}, types: { @@ -53,16 +55,7 @@ export default { }, types: {} }, - CheckWeight: { - extra: {}, - types: {} - }, - LockStakingStatus: { - extra: {}, - types: {} - }, - ValidateEquivocationReport: { - extra: {}, - types: {} - } + CheckWeight: EmptyCheck, + LockStakingStatus: EmptyCheck, + ValidateEquivocationReport: EmptyCheck } as ExtDef;