From 0d032ac0d97ede043691366ae0686b2e3e0a0d23 Mon Sep 17 00:00:00 2001 From: brenzi Date: Fri, 13 Sep 2024 11:42:56 +0200 Subject: [PATCH] new proposal types Petition and SpendNative (#1697) * run: dart run melos run run-polkadart-generate * start adding SpendNative * fix autogeneration duplicate CommunityIdentifier * skip proposals which fail to decode (empty) * stuck at null check * fix null exceptions when loading proposals. still not decoding Petition * fix petition demand display * fmt * fix lints * extract cidStr or global * fmt * add AI translations * add comment about handling purged proposals --------- Co-authored-by: clangenb <37865735+clangenb@users.noreply.github.com> --- app/lib/l10n/arb/app_de.arb | 30 ++ app/lib/l10n/arb/app_en.arb | 30 ++ app/lib/l10n/arb/app_fr.arb | 30 ++ app/lib/l10n/arb/app_ru.arb | 30 ++ app/lib/l10n/arb/app_sw.arb | 30 ++ .../democracy/democracy_page.dart | 9 +- app/lib/page-encointer/democracy/helpers.dart | 33 ++ .../encointer/encointer_api.dart | 22 +- packages/ew_polkadart/lib/ew_polkadart.dart | 10 +- .../encointer_kusama/encointer_kusama.dart | 12 +- .../encointer_kusama/pallets/aura.dart | 9 + .../encointer_kusama/pallets/balances.dart | 85 ++++- .../pallets/encointer_balances.dart | 4 +- .../pallets/encointer_bazaar.dart | 6 - .../pallets/encointer_ceremonies.dart | 14 - .../pallets/encointer_communities.dart | 25 +- .../pallets/encointer_democracy.dart | 114 ++++--- .../pallets/encointer_faucet.dart | 6 +- .../encointer_reputation_commitments.dart | 2 - .../pallets/encointer_scheduler.dart | 10 +- .../pallets/encointer_treasuries.dart | 18 + .../encointer_kusama/pallets/grandpa.dart | 28 +- .../encointer_kusama/pallets/proxy.dart | 121 ++++++- .../encointer_kusama/pallets/scheduler.dart | 42 ++- .../encointer_kusama/pallets/sudo.dart | 20 +- .../encointer_kusama/pallets/system.dart | 104 ++++-- .../encointer_kusama/pallets/timestamp.dart | 20 +- .../encointer_kusama/pallets/treasury.dart | 158 ++++++--- .../encointer_kusama/pallets/utility.dart | 75 ++++- .../runtime_event.dart | 54 +++ .../democracy/proposal.dart | 2 +- .../democracy/proposal_action.dart | 189 +++++++++++ .../democracy/proposal_action_identifier.dart | 106 ++++++ .../democracy/proposal_state.dart | 18 +- .../finality_grandpa/equivocation_1.dart | 6 +- .../finality_grandpa/equivocation_2.dart | 6 +- .../check_metadata_hash.dart | 63 ++++ .../frame_metadata_hash_extension/mode.dart | 57 ++++ .../traits/tokens/misc/id_amount.dart | 81 +++++ .../types/frame_system/pallet/call.dart | 48 ++- .../types/frame_system/pallet/error.dart | 11 +- .../types/pallet_balances/pallet/call.dart | 145 +++++++- .../pallet/call.dart | 4 +- .../pallet_encointer_bazaar/pallet/call.dart | 6 - .../pallet/call.dart | 14 - .../pallet/call.dart | 25 +- .../pallet/error.dart | 2 +- .../pallet/call.dart | 5 +- .../pallet/event.dart | 90 ++++- .../pallet_encointer_faucet/pallet/call.dart | 5 - .../pallet/call.dart | 2 - .../pallet/call.dart | 10 +- .../pallet/event.dart | 173 ++++++++++ .../types/pallet_grandpa/pallet/call.dart | 28 +- .../types/pallet_proxy/pallet/call.dart | 121 ++++++- .../types/pallet_scheduler/pallet/call.dart | 42 ++- .../types/pallet_sudo/pallet/call.dart | 20 +- .../types/pallet_timestamp/pallet/call.dart | 20 +- .../types/pallet_treasury/pallet/call.dart | 318 +++++++----------- .../types/pallet_treasury/pallet/error.dart | 47 ++- .../types/pallet_treasury/pallet/event.dart | 184 ++-------- .../types/pallet_utility/pallet/call.dart | 75 ++++- .../sp_consensus_grandpa/app/public.dart | 18 +- .../sp_consensus_grandpa/app/signature.dart | 18 +- .../sp_consensus_grandpa/equivocation.dart | 8 +- .../types/sp_runtime/multi_signature.dart | 30 +- .../encointer_kusama/types/tuples_2.dart | 25 +- 67 files changed, 2410 insertions(+), 763 deletions(-) create mode 100644 packages/ew_polkadart/lib/generated/encointer_kusama/pallets/aura.dart create mode 100644 packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_treasuries.dart create mode 100644 packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_metadata_hash_extension/check_metadata_hash.dart create mode 100644 packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_metadata_hash_extension/mode.dart create mode 100644 packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_support/traits/tokens/misc/id_amount.dart create mode 100644 packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_treasuries/pallet/event.dart diff --git a/app/lib/l10n/arb/app_de.arb b/app/lib/l10n/arb/app_de.arb index 489c76f30..61c1241fc 100644 --- a/app/lib/l10n/arb/app_de.arb +++ b/app/lib/l10n/arb/app_de.arb @@ -395,6 +395,36 @@ } } }, + "proposalPetition": "{cid} Petition: {value}", + "@proposalPetition": { + "placeholders": { + "cid": { + "type": "String", + "example": "global" + }, + "value": { + "type": "String", + "example": "Peace to the World" + } + } + }, + "proposalSpendNative": "{cid} Kasse soll {amount} KSM an {beneficiary} senden", + "@proposalSpendNative": { + "placeholders": { + "cid": { + "type": "String", + "example": "global" + }, + "amount": { + "type": "String", + "example": "0.00" + }, + "beneficiary": { + "type": "String", + "example": "HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F" + } + } + }, "proposalSupersededBy": "Verdrängt durch: {id}", "@proposalSupersededBy": { "placeholders": { diff --git a/app/lib/l10n/arb/app_en.arb b/app/lib/l10n/arb/app_en.arb index d72ba199f..0098cc6b4 100644 --- a/app/lib/l10n/arb/app_en.arb +++ b/app/lib/l10n/arb/app_en.arb @@ -547,6 +547,36 @@ } } }, + "proposalPetition": "{cid} petition: {value}", + "@proposalPetition": { + "placeholders": { + "cid": { + "type": "String", + "example": "global" + }, + "value": { + "type": "String", + "example": "Peace to the World" + } + } + }, + "proposalSpendNative": "{cid} treasury shall spend {amount} KSM to {beneficiary}", + "@proposalSpendNative": { + "placeholders": { + "cid": { + "type": "String", + "example": "global" + }, + "amount": { + "type": "String", + "example": "0.00" + }, + "beneficiary": { + "type": "String", + "example": "HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F" + } + } + }, "proposalSupersededBy": "Superseded by: {id}", "@proposalSupersededBy": { "placeholders": { diff --git a/app/lib/l10n/arb/app_fr.arb b/app/lib/l10n/arb/app_fr.arb index 9f3957c75..d6c3f9ecd 100644 --- a/app/lib/l10n/arb/app_fr.arb +++ b/app/lib/l10n/arb/app_fr.arb @@ -395,6 +395,36 @@ } } }, + "proposalPetition": "{cid} petition: {value}", + "@proposalPetition": { + "placeholders": { + "cid": { + "type": "String", + "example": "global" + }, + "value": { + "type": "String", + "example": "Peace to the World" + } + } + }, + "proposalSpendNative": "{cid} trèsor enverra {amount} KSM à {beneficiary}", + "@proposalSpendNative": { + "placeholders": { + "cid": { + "type": "String", + "example": "global" + }, + "amount": { + "type": "String", + "example": "0.00" + }, + "beneficiary": { + "type": "String", + "example": "HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F" + } + } + }, "proposalSupersededBy": "Epargné par: {id}", "@proposalSupersededBy": { "placeholders": { diff --git a/app/lib/l10n/arb/app_ru.arb b/app/lib/l10n/arb/app_ru.arb index ccfd07b12..fc3f28799 100644 --- a/app/lib/l10n/arb/app_ru.arb +++ b/app/lib/l10n/arb/app_ru.arb @@ -395,6 +395,36 @@ } } }, + "proposalPetition": "{cid} петиция: {value}", + "@proposalPetition": { + "placeholders": { + "cid": { + "type": "String", + "example": "global" + }, + "value": { + "type": "String", + "example": "Peace to the World" + } + } + }, + "proposalSpendNative": "{cid} Казначейство отправит {amount} KSM {beneficiary}", + "@proposalSpendNative": { + "placeholders": { + "cid": { + "type": "String", + "example": "global" + }, + "amount": { + "type": "String", + "example": "0.00" + }, + "beneficiary": { + "type": "String", + "example": "HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F" + } + } + }, "proposalSupersededBy": "заменен на: {id}", "@proposalSupersededBy": { "placeholders": { diff --git a/app/lib/l10n/arb/app_sw.arb b/app/lib/l10n/arb/app_sw.arb index 7700fd5dc..3bf0fd567 100644 --- a/app/lib/l10n/arb/app_sw.arb +++ b/app/lib/l10n/arb/app_sw.arb @@ -548,6 +548,36 @@ } } }, + "proposalPetition": "{cid} petitioni: {value}", + "@proposalPetition": { + "placeholders": { + "cid": { + "type": "String", + "example": "global" + }, + "value": { + "type": "String", + "example": "Peace to the World" + } + } + }, + "proposalSpendNative": "{cid} hazina itatuma {amount} KSM kwa {beneficiary}", + "@proposalSpendNative": { + "placeholders": { + "cid": { + "type": "String", + "example": "global" + }, + "amount": { + "type": "String", + "example": "0.00" + }, + "beneficiary": { + "type": "String", + "example": "HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F" + } + } + }, "proposalSupersededBy": "Imetanguliwa na: {id}", "@proposalSupersededBy": { "placeholders": { diff --git a/app/lib/page-encointer/democracy/democracy_page.dart b/app/lib/page-encointer/democracy/democracy_page.dart index 7d3a27267..b87d9c60d 100644 --- a/app/lib/page-encointer/democracy/democracy_page.dart +++ b/app/lib/page-encointer/democracy/democracy_page.dart @@ -41,12 +41,15 @@ class _DemocracyPageState extends State { } Future _init() async { - final proposalIds = await webApi.encointer.getHistoricProposalIds(count: BigInt.from(50)); + final maybeProposalIds = await webApi.encointer.getHistoricProposalIds(count: BigInt.from(50)); - final allProposals = await webApi.encointer.getProposals(proposalIds); + final allProposals = await webApi.encointer.getProposals(maybeProposalIds); + // Reduce proposalIds to the entries which also exist in allProposals + // this is necessary, because migrations may purge incompatible (non-decodable) proposals, + // but never the index + final proposalIds = maybeProposalIds.where(allProposals.containsKey).toList(); final allTallies = await webApi.encointer.getTallies(proposalIds); final allPurposeIds = await webApi.encointer.getProposalPurposeIds(proposalIds); - democracyParams = webApi.encointer.democracyParams(); proposals = allProposals; diff --git a/app/lib/page-encointer/democracy/helpers.dart b/app/lib/page-encointer/democracy/helpers.dart index 651c03cfc..27ec27c17 100644 --- a/app/lib/page-encointer/democracy/helpers.dart +++ b/app/lib/page-encointer/democracy/helpers.dart @@ -1,10 +1,13 @@ import 'dart:math'; +import 'package:encointer_wallet/config/consts.dart'; import 'package:encointer_wallet/l10n/l10.dart'; import 'package:encointer_wallet/models/communities/community_identifier.dart'; import 'package:encointer_wallet/service/service.dart'; import 'package:encointer_wallet/service/substrate_api/encointer/encointer_api.dart'; import 'package:encointer_wallet/store/app.dart'; +import 'package:encointer_wallet/utils/format.dart'; +import 'package:ew_keyring/ew_keyring.dart'; import 'package:ew_substrate_fixed/substrate_fixed.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -14,10 +17,12 @@ import 'package:ew_polkadart/encointer_types.dart' as et; import 'package:ew_polkadart/ew_polkadart.dart' show AddLocation, + Petition, Proposal, ProposalAction, RemoveLocation, SetInactivityTimeout, + SpendNative, Tally, UpdateDemurrage, UpdateNominalIncome; @@ -27,6 +32,7 @@ import 'package:ew_polkadart/ew_polkadart.dart' /// Todo: add localization for all variants. String getProposalActionTitle(BuildContext context, ProposalAction action) { final l10n = context.l10n; + final store = context.read(); switch (action.runtimeType) { case UpdateNominalIncome: @@ -52,11 +58,32 @@ String getProposalActionTitle(BuildContext context, ProposalAction action) { return 'Remove Location (unsupported)'; case SetInactivityTimeout: return 'SetInactivity Timeout (unsupported)'; + case Petition: + final cidPolkadart = getCommunityIdentifierFromProposal(action); + final cidStr = cidOrGlobal(cidPolkadart, store); + final demand = String.fromCharCodes((action as Petition).value1); + return l10n.proposalPetition(cidStr, demand); + case SpendNative: + final cidPolkadart = getCommunityIdentifierFromProposal(action); + final cidStr = cidOrGlobal(cidPolkadart, store); + final beneficiary = Fmt.address( + AddressUtils.pubKeyToAddress((action as SpendNative).value1, prefix: store.settings.currentNetwork.ss58()))!; + final amount = Fmt.token(action.value2, ertDecimals); + return l10n.proposalSpendNative(cidStr, amount, beneficiary); default: throw Exception('ProposalAction: Invalid Type: "${action.runtimeType}"'); } } +String cidOrGlobal(et.CommunityIdentifier? cidPolkadart, AppStore store) { + final cidStr = cidPolkadart == null + ? 'global' + : (store.encointer.communityStores![CommunityIdentifier(cidPolkadart.geohash, cidPolkadart.digest).toFmtString()] + ?.symbol ?? + CommunityIdentifier(cidPolkadart.geohash, cidPolkadart.digest).toFmtString()); + return cidStr; +} + double demurragePerMonth(double demurrage, BigInt blockProductionTime) { return (1 - exp(-1 * demurrage * blocksPerMonth(blockProductionTime))) * 100; } @@ -81,6 +108,12 @@ et.CommunityIdentifier? getCommunityIdentifierFromProposal(ProposalAction action case SetInactivityTimeout: // This is a global action hence all communities can vote for it. return null; + case Petition: + // can be global or local + return (action as Petition).value0; + case SpendNative: + // can be global or local + return (action as SpendNative).value0; default: throw Exception('ProposalAction: Invalid Type: "${action.runtimeType}"'); } diff --git a/app/lib/service/substrate_api/encointer/encointer_api.dart b/app/lib/service/substrate_api/encointer/encointer_api.dart index 07e5f499f..68641b8b5 100644 --- a/app/lib/service/substrate_api/encointer/encointer_api.dart +++ b/app/lib/service/substrate_api/encointer/encointer_api.dart @@ -734,21 +734,25 @@ class EncointerApi { Future> getProposals(List proposalIds, {BlockHash? at}) async { try { - // Keys including storage prefix. - Log.d("[getProposals] ProposalIds: $proposalIds')}"); + Log.d('[getProposals] ProposalIds: $proposalIds'); final proposals = await Future.wait(proposalIds.map( - (key) => encointerKusama.query.encointerDemocracy - .proposals(key, at: at ?? store.chain.latestHash) - .then((maybeProposal) => maybeProposal!), + (key) => encointerKusama.query.encointerDemocracy.proposals(key, at: at ?? store.chain.latestHash), )); - final proposalMap = Map.fromIterables(proposalIds, proposals); - Log.d('[getProposals] proposals: $proposalMap'); - return proposalMap; + // We need to assume that old proposals have been purged from the state. So we need to filter out null values. + final validProposals = {}; + for (var i = 0; i < proposalIds.length; i++) { + if (proposals[i] != null) { + validProposals[proposalIds[i]] = proposals[i]!; + } + } + + Log.d('[getProposals] valid proposals: $validProposals'); + return validProposals; } catch (e, s) { Log.e('[getProposals]', '$e', s); - return Map.of({}); + return {}; } } diff --git a/packages/ew_polkadart/lib/ew_polkadart.dart b/packages/ew_polkadart/lib/ew_polkadart.dart index 045f9f12a..178984b26 100644 --- a/packages/ew_polkadart/lib/ew_polkadart.dart +++ b/packages/ew_polkadart/lib/ew_polkadart.dart @@ -8,7 +8,15 @@ export 'package:polkadart/polkadart.dart'; // encointer democracy exports export 'generated/encointer_kusama/types/encointer_primitives/democracy/proposal.dart' show Proposal; export 'generated/encointer_kusama/types/encointer_primitives/democracy/proposal_action.dart' - show ProposalAction, AddLocation, RemoveLocation, UpdateDemurrage, UpdateNominalIncome, SetInactivityTimeout; + show + ProposalAction, + AddLocation, + RemoveLocation, + UpdateDemurrage, + UpdateNominalIncome, + SetInactivityTimeout, + Petition, + SpendNative; export 'generated/encointer_kusama/types/encointer_primitives/democracy/proposal_action_identifier.dart' show ProposalActionIdentifier; export 'generated/encointer_kusama/types/encointer_primitives/democracy/proposal_state.dart' diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/encointer_kusama.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/encointer_kusama.dart index eec90f098..317c9f7fa 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/encointer_kusama.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/encointer_kusama.dart @@ -1,8 +1,9 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i21; +import 'dart:async' as _i23; import 'package:polkadart/polkadart.dart' as _i1; +import 'pallets/aura.dart' as _i21; import 'pallets/balances.dart' as _i6; import 'pallets/encointer_balances.dart' as _i15; import 'pallets/encointer_bazaar.dart' as _i16; @@ -12,6 +13,7 @@ import 'pallets/encointer_democracy.dart' as _i19; import 'pallets/encointer_faucet.dart' as _i18; import 'pallets/encointer_reputation_commitments.dart' as _i17; import 'pallets/encointer_scheduler.dart' as _i12; +import 'pallets/encointer_treasuries.dart' as _i22; import 'pallets/grandpa.dart' as _i8; import 'pallets/proxy.dart' as _i9; import 'pallets/randomness_collective_flip.dart' as _i3; @@ -130,6 +132,8 @@ class Constants { final _i7.Constants transactionPayment = _i7.Constants(); + final _i21.Constants aura = _i21.Constants(); + final _i8.Constants grandpa = _i8.Constants(); final _i20.Constants utility = _i20.Constants(); @@ -151,6 +155,8 @@ class Constants { final _i18.Constants encointerFaucet = _i18.Constants(); final _i19.Constants encointerDemocracy = _i19.Constants(); + + final _i22.Constants encointerTreasuries = _i22.Constants(); } class Rpc { @@ -215,11 +221,11 @@ class EncointerKusama { final Registry registry; - _i21.Future connect() async { + _i23.Future connect() async { return await _provider.connect(); } - _i21.Future disconnect() async { + _i23.Future disconnect() async { return await _provider.disconnect(); } } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/aura.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/aura.dart new file mode 100644 index 000000000..d0e79435c --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/aura.dart @@ -0,0 +1,9 @@ +class Constants { + Constants(); + + /// The slot duration Aura should run with, expressed in milliseconds. + /// The effective value of this type should not change while the chain is running. + /// + /// For backwards compatibility either use [`MinimumPeriodTimesTwo`] or a const. + final BigInt slotDuration = BigInt.from(6000); +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/balances.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/balances.dart index 60680f5de..5d4a6cc35 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/balances.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/balances.dart @@ -6,11 +6,11 @@ import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i2; import '../types/encointer_node_notee_runtime/runtime_call.dart' as _i10; +import '../types/frame_support/traits/tokens/misc/id_amount.dart' as _i7; import '../types/pallet_balances/pallet/call.dart' as _i12; import '../types/pallet_balances/types/account_data.dart' as _i4; import '../types/pallet_balances/types/adjustment_direction.dart' as _i13; import '../types/pallet_balances/types/balance_lock.dart' as _i5; -import '../types/pallet_balances/types/id_amount.dart' as _i7; import '../types/pallet_balances/types/reserve_data.dart' as _i6; import '../types/sp_core/crypto/account_id32.dart' as _i3; import '../types/sp_runtime/multiaddress/multi_address.dart' as _i11; @@ -147,6 +147,8 @@ class Queries { /// Any liquidity locks on some account balances. /// NOTE: Should only be accessed when setting, changing and freeing a lock. + /// + /// Use of locks is deprecated in favour of freezes. See `https://github.com/paritytech/substrate/pull/12951/` _i8.Future> locks( _i3.AccountId32 key1, { _i1.BlockHash? at, @@ -163,6 +165,8 @@ class Queries { } /// Named reserves on some account balances. + /// + /// Use of reserves is deprecated in favour of holds. See `https://github.com/paritytech/substrate/pull/12951/` _i8.Future> reserves( _i3.AccountId32 key1, { _i1.BlockHash? at, @@ -286,7 +290,13 @@ class Queries { class Txs { const Txs(); - /// See [`Pallet::transfer_allow_death`]. + /// Transfer some liquid free balance to another account. + /// + /// `transfer_allow_death` will set the `FreeBalance` of the sender and receiver. + /// If the sender's account is below the existential deposit as a result + /// of the transfer, the account will be reaped. + /// + /// The dispatch origin for this call must be `Signed` by the transactor. _i10.RuntimeCall transferAllowDeath({ required _i11.MultiAddress dest, required BigInt value, @@ -298,7 +308,8 @@ class Txs { return _i10.RuntimeCall.values.balances(_call); } - /// See [`Pallet::force_transfer`]. + /// Exactly as `transfer_allow_death`, except the origin must be root and the source account + /// may be specified. _i10.RuntimeCall forceTransfer({ required _i11.MultiAddress source, required _i11.MultiAddress dest, @@ -312,7 +323,12 @@ class Txs { return _i10.RuntimeCall.values.balances(_call); } - /// See [`Pallet::transfer_keep_alive`]. + /// Same as the [`transfer_allow_death`] call, but with a check that the transfer will not + /// kill the origin account. + /// + /// 99% of the time you want [`transfer_allow_death`] instead. + /// + /// [`transfer_allow_death`]: struct.Pallet.html#method.transfer _i10.RuntimeCall transferKeepAlive({ required _i11.MultiAddress dest, required BigInt value, @@ -324,7 +340,21 @@ class Txs { return _i10.RuntimeCall.values.balances(_call); } - /// See [`Pallet::transfer_all`]. + /// Transfer the entire transferable balance from the caller account. + /// + /// NOTE: This function only attempts to transfer _transferable_ balances. This means that + /// any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be + /// transferred by this function. To ensure that this function results in a killed account, + /// you might need to prepare the account by removing any reference counters, storage + /// deposits, etc... + /// + /// The dispatch origin of this call must be Signed. + /// + /// - `dest`: The recipient of the transfer. + /// - `keep_alive`: A boolean to determine if the `transfer_all` operation should send all + /// of the funds the account has, causing the sender account to be killed (false), or + /// transfer everything except at least the existential deposit, which will guarantee to + /// keep the sender account alive (true). _i10.RuntimeCall transferAll({ required _i11.MultiAddress dest, required bool keepAlive, @@ -336,7 +366,9 @@ class Txs { return _i10.RuntimeCall.values.balances(_call); } - /// See [`Pallet::force_unreserve`]. + /// Unreserve some balance from a user by force. + /// + /// Can only be called by ROOT. _i10.RuntimeCall forceUnreserve({ required _i11.MultiAddress who, required BigInt amount, @@ -348,13 +380,22 @@ class Txs { return _i10.RuntimeCall.values.balances(_call); } - /// See [`Pallet::upgrade_accounts`]. + /// Upgrade a specified account. + /// + /// - `origin`: Must be `Signed`. + /// - `who`: The account to be upgraded. + /// + /// This will waive the transaction fee if at least all but 10% of the accounts needed to + /// be upgraded. (We let some not have to be upgraded just in order to allow for the + /// possibility of churn). _i10.RuntimeCall upgradeAccounts({required List<_i3.AccountId32> who}) { final _call = _i12.Call.values.upgradeAccounts(who: who); return _i10.RuntimeCall.values.balances(_call); } - /// See [`Pallet::force_set_balance`]. + /// Set the regular balance of a given account. + /// + /// The dispatch origin for this call is `root`. _i10.RuntimeCall forceSetBalance({ required _i11.MultiAddress who, required BigInt newFree, @@ -366,7 +407,11 @@ class Txs { return _i10.RuntimeCall.values.balances(_call); } - /// See [`Pallet::force_adjust_total_issuance`]. + /// Adjust the total issuance in a saturating way. + /// + /// Can only be called by root and always needs a positive `delta`. + /// + /// # Example _i10.RuntimeCall forceAdjustTotalIssuance({ required _i13.AdjustmentDirection direction, required BigInt delta, @@ -377,6 +422,24 @@ class Txs { ); return _i10.RuntimeCall.values.balances(_call); } + + /// Burn the specified liquid free balance from the origin account. + /// + /// If the origin's account ends up below the existential deposit as a result + /// of the burn and `keep_alive` is false, the account will be reaped. + /// + /// Unlike sending funds to a _burn_ address, which merely makes the funds inaccessible, + /// this `burn` operation will reduce total issuance by the amount _burned_. + _i10.RuntimeCall burn({ + required BigInt value, + required bool keepAlive, + }) { + final _call = _i12.Call.values.burn( + value: value, + keepAlive: keepAlive, + ); + return _i10.RuntimeCall.values.balances(_call); + } } class Constants { @@ -394,9 +457,13 @@ class Constants { /// The maximum number of locks that should exist on an account. /// Not strictly enforced, but used for weight estimation. + /// + /// Use of locks is deprecated in favour of freezes. See `https://github.com/paritytech/substrate/pull/12951/` final int maxLocks = 50; /// The maximum number of named reserves that can exist on an account. + /// + /// Use of reserves is deprecated in favour of holds. See `https://github.com/paritytech/substrate/pull/12951/` final int maxReserves = 128; /// The maximum number of individual freeze locks that can exist on an account at any time. diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_balances.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_balances.dart index 2cb606473..507dde9ce 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_balances.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_balances.dart @@ -168,7 +168,7 @@ class Queries { class Txs { const Txs(); - /// See [`Pallet::transfer`]. + /// Transfer some balance to another account. _i10.RuntimeCall transfer({ required _i4.AccountId32 dest, required _i2.CommunityIdentifier communityId, @@ -182,13 +182,11 @@ class Txs { return _i10.RuntimeCall.values.encointerBalances(_call); } - /// See [`Pallet::set_fee_conversion_factor`]. _i10.RuntimeCall setFeeConversionFactor({required BigInt feeConversionFactor}) { final _call = _i11.Call.values.setFeeConversionFactor(feeConversionFactor: feeConversionFactor); return _i10.RuntimeCall.values.encointerBalances(_call); } - /// See [`Pallet::transfer_all`]. _i10.RuntimeCall transferAll({ required _i4.AccountId32 dest, required _i2.CommunityIdentifier cid, diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_bazaar.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_bazaar.dart index 140dc22d0..7a675c8ca 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_bazaar.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_bazaar.dart @@ -126,7 +126,6 @@ class Queries { class Txs { const Txs(); - /// See [`Pallet::create_business`]. _i10.RuntimeCall createBusiness({ required _i2.CommunityIdentifier cid, required List url, @@ -138,7 +137,6 @@ class Txs { return _i10.RuntimeCall.values.encointerBazaar(_call); } - /// See [`Pallet::update_business`]. _i10.RuntimeCall updateBusiness({ required _i2.CommunityIdentifier cid, required List url, @@ -150,13 +148,11 @@ class Txs { return _i10.RuntimeCall.values.encointerBazaar(_call); } - /// See [`Pallet::delete_business`]. _i10.RuntimeCall deleteBusiness({required _i2.CommunityIdentifier cid}) { final _call = _i11.Call.values.deleteBusiness(cid: cid); return _i10.RuntimeCall.values.encointerBazaar(_call); } - /// See [`Pallet::create_offering`]. _i10.RuntimeCall createOffering({ required _i2.CommunityIdentifier cid, required List url, @@ -168,7 +164,6 @@ class Txs { return _i10.RuntimeCall.values.encointerBazaar(_call); } - /// See [`Pallet::update_offering`]. _i10.RuntimeCall updateOffering({ required _i2.CommunityIdentifier cid, required int oid, @@ -182,7 +177,6 @@ class Txs { return _i10.RuntimeCall.values.encointerBazaar(_call); } - /// See [`Pallet::delete_offering`]. _i10.RuntimeCall deleteOffering({ required _i2.CommunityIdentifier cid, required int oid, diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_ceremonies.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_ceremonies.dart index e91ec5267..bd110d783 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_ceremonies.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_ceremonies.dart @@ -1488,7 +1488,6 @@ class Queries { class Txs { const Txs(); - /// See [`Pallet::register_participant`]. _i14.RuntimeCall registerParticipant({ required _i2.CommunityIdentifier cid, _i15.ProofOfAttendance? proof, @@ -1500,7 +1499,6 @@ class Txs { return _i14.RuntimeCall.values.encointerCeremonies(_call); } - /// See [`Pallet::upgrade_registration`]. _i14.RuntimeCall upgradeRegistration({ required _i2.CommunityIdentifier cid, required _i15.ProofOfAttendance proof, @@ -1512,7 +1510,6 @@ class Txs { return _i14.RuntimeCall.values.encointerCeremonies(_call); } - /// See [`Pallet::unregister_participant`]. _i14.RuntimeCall unregisterParticipant({ required _i2.CommunityIdentifier cid, _i5.Tuple2<_i2.CommunityIdentifier, int>? maybeReputationCommunityCeremony, @@ -1524,7 +1521,6 @@ class Txs { return _i14.RuntimeCall.values.encointerCeremonies(_call); } - /// See [`Pallet::attest_attendees`]. _i14.RuntimeCall attestAttendees({ required _i2.CommunityIdentifier cid, required int numberOfParticipantsVote, @@ -1538,7 +1534,6 @@ class Txs { return _i14.RuntimeCall.values.encointerCeremonies(_call); } - /// See [`Pallet::endorse_newcomer`]. _i14.RuntimeCall endorseNewcomer({ required _i2.CommunityIdentifier cid, required _i3.AccountId32 newbie, @@ -1550,7 +1545,6 @@ class Txs { return _i14.RuntimeCall.values.encointerCeremonies(_call); } - /// See [`Pallet::claim_rewards`]. _i14.RuntimeCall claimRewards({ required _i2.CommunityIdentifier cid, BigInt? maybeMeetupIndex, @@ -1562,51 +1556,43 @@ class Txs { return _i14.RuntimeCall.values.encointerCeremonies(_call); } - /// See [`Pallet::set_inactivity_timeout`]. _i14.RuntimeCall setInactivityTimeout({required int inactivityTimeout}) { final _call = _i16.Call.values.setInactivityTimeout(inactivityTimeout: inactivityTimeout); return _i14.RuntimeCall.values.encointerCeremonies(_call); } - /// See [`Pallet::set_endorsement_tickets_per_bootstrapper`]. _i14.RuntimeCall setEndorsementTicketsPerBootstrapper({required int endorsementTicketsPerBootstrapper}) { final _call = _i16.Call.values .setEndorsementTicketsPerBootstrapper(endorsementTicketsPerBootstrapper: endorsementTicketsPerBootstrapper); return _i14.RuntimeCall.values.encointerCeremonies(_call); } - /// See [`Pallet::set_endorsement_tickets_per_reputable`]. _i14.RuntimeCall setEndorsementTicketsPerReputable({required int endorsementTicketsPerReputable}) { final _call = _i16.Call.values .setEndorsementTicketsPerReputable(endorsementTicketsPerReputable: endorsementTicketsPerReputable); return _i14.RuntimeCall.values.encointerCeremonies(_call); } - /// See [`Pallet::set_reputation_lifetime`]. _i14.RuntimeCall setReputationLifetime({required int reputationLifetime}) { final _call = _i16.Call.values.setReputationLifetime(reputationLifetime: reputationLifetime); return _i14.RuntimeCall.values.encointerCeremonies(_call); } - /// See [`Pallet::set_meetup_time_offset`]. _i14.RuntimeCall setMeetupTimeOffset({required int meetupTimeOffset}) { final _call = _i16.Call.values.setMeetupTimeOffset(meetupTimeOffset: meetupTimeOffset); return _i14.RuntimeCall.values.encointerCeremonies(_call); } - /// See [`Pallet::set_time_tolerance`]. _i14.RuntimeCall setTimeTolerance({required BigInt timeTolerance}) { final _call = _i16.Call.values.setTimeTolerance(timeTolerance: timeTolerance); return _i14.RuntimeCall.values.encointerCeremonies(_call); } - /// See [`Pallet::set_location_tolerance`]. _i14.RuntimeCall setLocationTolerance({required int locationTolerance}) { final _call = _i16.Call.values.setLocationTolerance(locationTolerance: locationTolerance); return _i14.RuntimeCall.values.encointerCeremonies(_call); } - /// See [`Pallet::purge_community_ceremony`]. _i14.RuntimeCall purgeCommunityCeremony({required _i5.Tuple2<_i2.CommunityIdentifier, int> communityCeremony}) { final _call = _i16.Call.values.purgeCommunityCeremony(communityCeremony: communityCeremony); return _i14.RuntimeCall.values.encointerCeremonies(_call); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_communities.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_communities.dart index 056384ffe..dadb93445 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_communities.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_communities.dart @@ -363,7 +363,9 @@ class Queries { class Txs { const Txs(); - /// See [`Pallet::new_community`]. + /// Add a new community. + /// + /// May only be called from `T::TrustableForNonDestructiveAction`. _i12.RuntimeCall newCommunity({ required _i5.Location location, required List<_i6.AccountId32> bootstrappers, @@ -381,7 +383,11 @@ class Txs { return _i12.RuntimeCall.values.encointerCommunities(_call); } - /// See [`Pallet::add_location`]. + /// Add a new meetup `location` to the community with `cid`. + /// + /// May only be called from `T::TrustableForNonDestructiveAction`. + /// + /// Todo: Replace `T::CommunityMaster` with community governance: #137. _i12.RuntimeCall addLocation({ required _i3.CommunityIdentifier cid, required _i5.Location location, @@ -393,7 +399,11 @@ class Txs { return _i12.RuntimeCall.values.encointerCommunities(_call); } - /// See [`Pallet::remove_location`]. + /// Remove an existing meetup `location` from the community with `cid`. + /// + /// May only be called from `T::CommunityMaster`. + /// + /// Todo: Replace `T::CommunityMaster` with community governance: #137. _i12.RuntimeCall removeLocation({ required _i3.CommunityIdentifier cid, required _i5.Location location, @@ -405,7 +415,9 @@ class Txs { return _i12.RuntimeCall.values.encointerCommunities(_call); } - /// See [`Pallet::update_community_metadata`]. + /// Update the metadata of the community with `cid`. + /// + /// May only be called from `T::CommunityMaster`. _i12.RuntimeCall updateCommunityMetadata({ required _i3.CommunityIdentifier cid, required _i7.CommunityMetadata communityMetadata, @@ -417,7 +429,6 @@ class Txs { return _i12.RuntimeCall.values.encointerCommunities(_call); } - /// See [`Pallet::update_demurrage`]. _i12.RuntimeCall updateDemurrage({ required _i3.CommunityIdentifier cid, required _i13.FixedI128 demurrage, @@ -429,7 +440,6 @@ class Txs { return _i12.RuntimeCall.values.encointerCommunities(_call); } - /// See [`Pallet::update_nominal_income`]. _i12.RuntimeCall updateNominalIncome({ required _i3.CommunityIdentifier cid, required _i8.FixedU128 nominalIncome, @@ -441,19 +451,16 @@ class Txs { return _i12.RuntimeCall.values.encointerCommunities(_call); } - /// See [`Pallet::set_min_solar_trip_time_s`]. _i12.RuntimeCall setMinSolarTripTimeS({required int minSolarTripTimeS}) { final _call = _i14.Call.values.setMinSolarTripTimeS(minSolarTripTimeS: minSolarTripTimeS); return _i12.RuntimeCall.values.encointerCommunities(_call); } - /// See [`Pallet::set_max_speed_mps`]. _i12.RuntimeCall setMaxSpeedMps({required int maxSpeedMps}) { final _call = _i14.Call.values.setMaxSpeedMps(maxSpeedMps: maxSpeedMps); return _i12.RuntimeCall.values.encointerCommunities(_call); } - /// See [`Pallet::purge_community`]. _i12.RuntimeCall purgeCommunity({required _i3.CommunityIdentifier cid}) { final _call = _i14.Call.values.purgeCommunity(cid: cid); return _i12.RuntimeCall.values.encointerCommunities(_call); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_democracy.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_democracy.dart index 0a4fab19f..aee5f204e 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_democracy.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_democracy.dart @@ -1,19 +1,19 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i6; -import 'dart:typed_data' as _i7; +import 'dart:async' as _i7; +import 'dart:typed_data' as _i8; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i2; -import '../types/encointer_node_notee_runtime/runtime_call.dart' as _i8; +import '../types/encointer_node_notee_runtime/runtime_call.dart' as _i9; import '../types/encointer_primitives/communities/community_identifier.dart' as _i13; import '../types/encointer_primitives/democracy/proposal.dart' as _i3; -import '../types/encointer_primitives/democracy/proposal_action.dart' as _i9; +import '../types/encointer_primitives/democracy/proposal_action.dart' as _i10; import '../types/encointer_primitives/democracy/proposal_action_identifier.dart' as _i5; import '../types/encointer_primitives/democracy/tally.dart' as _i4; -import '../types/encointer_primitives/democracy/vote.dart' as _i11; -import '../types/pallet_encointer_democracy/pallet/call.dart' as _i10; -import '../types/tuples.dart' as _i12; +import '../types/encointer_primitives/democracy/vote.dart' as _i12; +import '../types/pallet_encointer_democracy/pallet/call.dart' as _i11; +import '../types/tuples.dart' as _i6; class Queries { const Queries(this.__api); @@ -47,11 +47,14 @@ class Queries { hasher: _i1.StorageHasher.blake2b128Concat(_i2.U128Codec.codec), ); - final _i1.StorageMap<_i5.ProposalActionIdentifier, BigInt> _cancelledAt = - const _i1.StorageMap<_i5.ProposalActionIdentifier, BigInt>( + final _i1.StorageMap<_i5.ProposalActionIdentifier, _i6.Tuple2> _lastApprovedProposalForAction = + const _i1.StorageMap<_i5.ProposalActionIdentifier, _i6.Tuple2>( prefix: 'EncointerDemocracy', - storage: 'CancelledAt', - valueCodec: _i2.U64Codec.codec, + storage: 'LastApprovedProposalForAction', + valueCodec: _i6.Tuple2Codec( + _i2.U64Codec.codec, + _i2.U128Codec.codec, + ), hasher: _i1.StorageHasher.blake2b128Concat(_i5.ProposalActionIdentifier.codec), ); @@ -63,7 +66,10 @@ class Queries { hasher: _i1.StorageHasher.blake2b128Concat(_i5.ProposalActionIdentifier.codec), ); - _i6.Future purposeIds( + /// Unique `PurposeIds` of a `Proposal`. + /// + /// This is used to prevent reuse of a reputation for the same `PurposeId`. + _i7.Future purposeIds( BigInt key1, { _i1.BlockHash? at, }) async { @@ -78,7 +84,8 @@ class Queries { return null; /* Nullable */ } - _i6.Future<_i3.Proposal?> proposals( + /// All proposals that have ever been proposed including the past ones. + _i7.Future<_i3.Proposal?> proposals( BigInt key1, { _i1.BlockHash? at, }) async { @@ -93,7 +100,8 @@ class Queries { return null; /* Nullable */ } - _i6.Future proposalCount({_i1.BlockHash? at}) async { + /// Proposal count of all proposals to date. + _i7.Future proposalCount({_i1.BlockHash? at}) async { final hashedKey = _proposalCount.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -105,7 +113,8 @@ class Queries { return BigInt.zero; /* Default */ } - _i6.Future<_i4.Tally?> tallies( + /// Tallies for the proposal corresponding to `ProposalId`. + _i7.Future<_i4.Tally?> tallies( BigInt key1, { _i1.BlockHash? at, }) async { @@ -120,22 +129,22 @@ class Queries { return null; /* Nullable */ } - _i6.Future cancelledAt( + _i7.Future<_i6.Tuple2?> lastApprovedProposalForAction( _i5.ProposalActionIdentifier key1, { _i1.BlockHash? at, }) async { - final hashedKey = _cancelledAt.hashedKeyFor(key1); + final hashedKey = _lastApprovedProposalForAction.hashedKeyFor(key1); final bytes = await __api.getStorage( hashedKey, at: at, ); if (bytes != null) { - return _cancelledAt.decodeValue(bytes); + return _lastApprovedProposalForAction.decodeValue(bytes); } return null; /* Nullable */ } - _i6.Future enactmentQueue( + _i7.Future enactmentQueue( _i5.ProposalActionIdentifier key1, { _i1.BlockHash? at, }) async { @@ -151,67 +160,67 @@ class Queries { } /// Returns the storage key for `purposeIds`. - _i7.Uint8List purposeIdsKey(BigInt key1) { + _i8.Uint8List purposeIdsKey(BigInt key1) { final hashedKey = _purposeIds.hashedKeyFor(key1); return hashedKey; } /// Returns the storage key for `proposals`. - _i7.Uint8List proposalsKey(BigInt key1) { + _i8.Uint8List proposalsKey(BigInt key1) { final hashedKey = _proposals.hashedKeyFor(key1); return hashedKey; } /// Returns the storage key for `proposalCount`. - _i7.Uint8List proposalCountKey() { + _i8.Uint8List proposalCountKey() { final hashedKey = _proposalCount.hashedKey(); return hashedKey; } /// Returns the storage key for `tallies`. - _i7.Uint8List talliesKey(BigInt key1) { + _i8.Uint8List talliesKey(BigInt key1) { final hashedKey = _tallies.hashedKeyFor(key1); return hashedKey; } - /// Returns the storage key for `cancelledAt`. - _i7.Uint8List cancelledAtKey(_i5.ProposalActionIdentifier key1) { - final hashedKey = _cancelledAt.hashedKeyFor(key1); + /// Returns the storage key for `lastApprovedProposalForAction`. + _i8.Uint8List lastApprovedProposalForActionKey(_i5.ProposalActionIdentifier key1) { + final hashedKey = _lastApprovedProposalForAction.hashedKeyFor(key1); return hashedKey; } /// Returns the storage key for `enactmentQueue`. - _i7.Uint8List enactmentQueueKey(_i5.ProposalActionIdentifier key1) { + _i8.Uint8List enactmentQueueKey(_i5.ProposalActionIdentifier key1) { final hashedKey = _enactmentQueue.hashedKeyFor(key1); return hashedKey; } /// Returns the storage map key prefix for `purposeIds`. - _i7.Uint8List purposeIdsMapPrefix() { + _i8.Uint8List purposeIdsMapPrefix() { final hashedKey = _purposeIds.mapPrefix(); return hashedKey; } /// Returns the storage map key prefix for `proposals`. - _i7.Uint8List proposalsMapPrefix() { + _i8.Uint8List proposalsMapPrefix() { final hashedKey = _proposals.mapPrefix(); return hashedKey; } /// Returns the storage map key prefix for `tallies`. - _i7.Uint8List talliesMapPrefix() { + _i8.Uint8List talliesMapPrefix() { final hashedKey = _tallies.mapPrefix(); return hashedKey; } - /// Returns the storage map key prefix for `cancelledAt`. - _i7.Uint8List cancelledAtMapPrefix() { - final hashedKey = _cancelledAt.mapPrefix(); + /// Returns the storage map key prefix for `lastApprovedProposalForAction`. + _i8.Uint8List lastApprovedProposalForActionMapPrefix() { + final hashedKey = _lastApprovedProposalForAction.mapPrefix(); return hashedKey; } /// Returns the storage map key prefix for `enactmentQueue`. - _i7.Uint8List enactmentQueueMapPrefix() { + _i8.Uint8List enactmentQueueMapPrefix() { final hashedKey = _enactmentQueue.mapPrefix(); return hashedKey; } @@ -220,41 +229,48 @@ class Queries { class Txs { const Txs(); - /// See [`Pallet::submit_proposal`]. - _i8.RuntimeCall submitProposal({required _i9.ProposalAction proposalAction}) { - final _call = _i10.Call.values.submitProposal(proposalAction: proposalAction); - return _i8.RuntimeCall.values.encointerDemocracy(_call); + _i9.RuntimeCall submitProposal({required _i10.ProposalAction proposalAction}) { + final _call = _i11.Call.values.submitProposal(proposalAction: proposalAction); + return _i9.RuntimeCall.values.encointerDemocracy(_call); } - /// See [`Pallet::vote`]. - _i8.RuntimeCall vote({ + _i9.RuntimeCall vote({ required BigInt proposalId, - required _i11.Vote vote, - required List<_i12.Tuple2<_i13.CommunityIdentifier, int>> reputations, + required _i12.Vote vote, + required List<_i6.Tuple2<_i13.CommunityIdentifier, int>> reputations, }) { - final _call = _i10.Call.values.vote( + final _call = _i11.Call.values.vote( proposalId: proposalId, vote: vote, reputations: reputations, ); - return _i8.RuntimeCall.values.encointerDemocracy(_call); + return _i9.RuntimeCall.values.encointerDemocracy(_call); } - /// See [`Pallet::update_proposal_state`]. - _i8.RuntimeCall updateProposalState({required BigInt proposalId}) { - final _call = _i10.Call.values.updateProposalState(proposalId: proposalId); - return _i8.RuntimeCall.values.encointerDemocracy(_call); + _i9.RuntimeCall updateProposalState({required BigInt proposalId}) { + final _call = _i11.Call.values.updateProposalState(proposalId: proposalId); + return _i9.RuntimeCall.values.encointerDemocracy(_call); } } class Constants { Constants(); - final int maxReputationVecLength = 64; + /// Maximum reputation count to be supplied in the extrinsics. + final int maxReputationCount = 64; + /// The Period in which the proposal has to be in passing state before it is approved. final BigInt confirmationPeriod = BigInt.from(300000); + /// The total lifetime of a proposal. + /// + /// If the proposal isn't approved within its lifetime, it will be cancelled. + /// + /// Note: In cycles this must be smaller than `ReputationLifetime`, otherwise the eligible + /// electorate will be 0. final BigInt proposalLifetime = BigInt.from(1200000); + /// Minimum turnout in permill for a proposal to be considered as passing and entering the + /// `Confirming` state. final BigInt minTurnout = BigInt.one; } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_faucet.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_faucet.dart index 56ac656b8..db8b69aee 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_faucet.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_faucet.dart @@ -79,7 +79,6 @@ class Queries { class Txs { const Txs(); - /// See [`Pallet::create_faucet`]. _i7.RuntimeCall createFaucet({ required List name, required BigInt amount, @@ -95,7 +94,6 @@ class Txs { return _i7.RuntimeCall.values.encointerFaucet(_call); } - /// See [`Pallet::drip`]. _i7.RuntimeCall drip({ required _i2.AccountId32 faucetAccount, required _i8.CommunityIdentifier cid, @@ -109,7 +107,6 @@ class Txs { return _i7.RuntimeCall.values.encointerFaucet(_call); } - /// See [`Pallet::dissolve_faucet`]. _i7.RuntimeCall dissolveFaucet({ required _i2.AccountId32 faucetAccount, required _i2.AccountId32 beneficiary, @@ -121,13 +118,11 @@ class Txs { return _i7.RuntimeCall.values.encointerFaucet(_call); } - /// See [`Pallet::close_faucet`]. _i7.RuntimeCall closeFaucet({required _i2.AccountId32 faucetAccount}) { final _call = _i9.Call.values.closeFaucet(faucetAccount: faucetAccount); return _i7.RuntimeCall.values.encointerFaucet(_call); } - /// See [`Pallet::set_reserve_amount`]. _i7.RuntimeCall setReserveAmount({required BigInt reserveAmount}) { final _call = _i9.Call.values.setReserveAmount(reserveAmount: reserveAmount); return _i7.RuntimeCall.values.encointerFaucet(_call); @@ -137,6 +132,7 @@ class Txs { class Constants { Constants(); + /// The treasury's pallet id, used for deriving its sovereign account ID. final _i10.PalletId palletId = const [ 101, 99, diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_reputation_commitments.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_reputation_commitments.dart index 5dd67a1ea..890314f11 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_reputation_commitments.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_reputation_commitments.dart @@ -136,13 +136,11 @@ class Queries { class Txs { const Txs(); - /// See [`Pallet::register_purpose`]. _i9.RuntimeCall registerPurpose({required List descriptor}) { final _call = _i10.Call.values.registerPurpose(descriptor: descriptor); return _i9.RuntimeCall.values.encointerReputationCommitments(_call); } - /// See [`Pallet::commit_reputation`]. _i9.RuntimeCall commitReputation({ required _i4.CommunityIdentifier cid, required int cindex, diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_scheduler.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_scheduler.dart index 962c9cb44..d2727b49d 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_scheduler.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_scheduler.dart @@ -149,19 +149,22 @@ class Queries { class Txs { const Txs(); - /// See [`Pallet::next_phase`]. + /// Manually transition to next phase without affecting the ceremony rhythm + /// + /// May only be called from `T::CeremonyMaster`. _i6.RuntimeCall nextPhase() { final _call = _i7.Call.values.nextPhase(); return _i6.RuntimeCall.values.encointerScheduler(_call); } - /// See [`Pallet::push_by_one_day`]. + /// Push next phase change by one entire day + /// + /// May only be called from `T::CeremonyMaster`. _i6.RuntimeCall pushByOneDay() { final _call = _i7.Call.values.pushByOneDay(); return _i6.RuntimeCall.values.encointerScheduler(_call); } - /// See [`Pallet::set_phase_duration`]. _i6.RuntimeCall setPhaseDuration({ required _i3.CeremonyPhaseType ceremonyPhase, required BigInt duration, @@ -173,7 +176,6 @@ class Txs { return _i6.RuntimeCall.values.encointerScheduler(_call); } - /// See [`Pallet::set_next_phase_timestamp`]. _i6.RuntimeCall setNextPhaseTimestamp({required BigInt timestamp}) { final _call = _i7.Call.values.setNextPhaseTimestamp(timestamp: timestamp); return _i6.RuntimeCall.values.encointerScheduler(_call); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_treasuries.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_treasuries.dart new file mode 100644 index 000000000..4277b2cf2 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_treasuries.dart @@ -0,0 +1,18 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import '../types/frame_support/pallet_id.dart' as _i1; + +class Constants { + Constants(); + + /// The treasuries' pallet id, used for deriving sovereign account IDs per community. + final _i1.PalletId palletId = const [ + 116, + 114, + 115, + 114, + 121, + 115, + 73, + 100, + ]; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/grandpa.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/grandpa.dart index 12589b868..c4cd4d8cf 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/grandpa.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/grandpa.dart @@ -226,7 +226,10 @@ class Queries { class Txs { const Txs(); - /// See [`Pallet::report_equivocation`]. + /// Report voter equivocation/misbehavior. This method will verify the + /// equivocation proof and validate the given key ownership proof + /// against the extracted offender. If both are valid, the offence + /// will be reported. _i10.RuntimeCall reportEquivocation({ required _i11.EquivocationProof equivocationProof, required _i12.Void keyOwnerProof, @@ -238,7 +241,15 @@ class Txs { return _i10.RuntimeCall.values.grandpa(_call); } - /// See [`Pallet::report_equivocation_unsigned`]. + /// Report voter equivocation/misbehavior. This method will verify the + /// equivocation proof and validate the given key ownership proof + /// against the extracted offender. If both are valid, the offence + /// will be reported. + /// + /// This extrinsic must be called unsigned and it is expected that only + /// block authors will call it (validated in `ValidateUnsigned`), as such + /// if the block author is defined it will be defined as the equivocation + /// reporter. _i10.RuntimeCall reportEquivocationUnsigned({ required _i11.EquivocationProof equivocationProof, required _i12.Void keyOwnerProof, @@ -250,7 +261,18 @@ class Txs { return _i10.RuntimeCall.values.grandpa(_call); } - /// See [`Pallet::note_stalled`]. + /// Note that the current authority set of the GRANDPA finality gadget has stalled. + /// + /// This will trigger a forced authority set change at the beginning of the next session, to + /// be enacted `delay` blocks after that. The `delay` should be high enough to safely assume + /// that the block signalling the forced change will not be re-orged e.g. 1000 blocks. + /// The block production rate (which may be slowed down because of finality lagging) should + /// be taken into account when choosing the `delay`. The GRANDPA voters based on the new + /// authority will start voting on top of `best_finalized_block_number` for new finalized + /// blocks. `best_finalized_block_number` should be the highest of the latest finalized + /// block of all validators of the new authority set. + /// + /// Only callable by root. _i10.RuntimeCall noteStalled({ required int delay, required int bestFinalizedBlockNumber, diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/proxy.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/proxy.dart index 70a85b3a4..f50c670fc 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/proxy.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/proxy.dart @@ -109,7 +109,15 @@ class Queries { class Txs { const Txs(); - /// See [`Pallet::proxy`]. + /// Dispatch the given `call` from an account that the sender is authorised for through + /// `add_proxy`. + /// + /// The dispatch origin for this call must be _Signed_. + /// + /// Parameters: + /// - `real`: The account that the proxy will make a call on behalf of. + /// - `force_proxy_type`: Specify the exact proxy type to be used and checked for this call. + /// - `call`: The call to be made by the `real` account. _i9.RuntimeCall proxy({ required _i10.MultiAddress real, _i11.ProxyType? forceProxyType, @@ -123,7 +131,15 @@ class Txs { return _i9.RuntimeCall.values.proxy(_call); } - /// See [`Pallet::add_proxy`]. + /// Register a proxy account for the sender that is able to make calls on its behalf. + /// + /// The dispatch origin for this call must be _Signed_. + /// + /// Parameters: + /// - `proxy`: The account that the `caller` would like to make a proxy. + /// - `proxy_type`: The permissions allowed for this proxy account. + /// - `delay`: The announcement period required of the initial proxy. Will generally be + /// zero. _i9.RuntimeCall addProxy({ required _i10.MultiAddress delegate, required _i11.ProxyType proxyType, @@ -137,7 +153,13 @@ class Txs { return _i9.RuntimeCall.values.proxy(_call); } - /// See [`Pallet::remove_proxy`]. + /// Unregister a proxy account for the sender. + /// + /// The dispatch origin for this call must be _Signed_. + /// + /// Parameters: + /// - `proxy`: The account that the `caller` would like to remove as a proxy. + /// - `proxy_type`: The permissions currently enabled for the removed proxy account. _i9.RuntimeCall removeProxy({ required _i10.MultiAddress delegate, required _i11.ProxyType proxyType, @@ -151,13 +173,35 @@ class Txs { return _i9.RuntimeCall.values.proxy(_call); } - /// See [`Pallet::remove_proxies`]. + /// Unregister all proxy accounts for the sender. + /// + /// The dispatch origin for this call must be _Signed_. + /// + /// WARNING: This may be called on accounts created by `pure`, however if done, then + /// the unreserved fees will be inaccessible. **All access to this account will be lost.** _i9.RuntimeCall removeProxies() { final _call = _i12.Call.values.removeProxies(); return _i9.RuntimeCall.values.proxy(_call); } - /// See [`Pallet::create_pure`]. + /// Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and + /// initialize it with a proxy of `proxy_type` for `origin` sender. + /// + /// Requires a `Signed` origin. + /// + /// - `proxy_type`: The type of the proxy that the sender will be registered as over the + /// new account. This will almost always be the most permissive `ProxyType` possible to + /// allow for maximum flexibility. + /// - `index`: A disambiguation index, in case this is called multiple times in the same + /// transaction (e.g. with `utility::batch`). Unless you're using `batch` you probably just + /// want to use `0`. + /// - `delay`: The announcement period required of the initial proxy. Will generally be + /// zero. + /// + /// Fails with `Duplicate` if this has already been called in this transaction, from the + /// same sender, with the same parameters. + /// + /// Fails if there are insufficient funds to pay for deposit. _i9.RuntimeCall createPure({ required _i11.ProxyType proxyType, required int delay, @@ -171,7 +215,22 @@ class Txs { return _i9.RuntimeCall.values.proxy(_call); } - /// See [`Pallet::kill_pure`]. + /// Removes a previously spawned pure proxy. + /// + /// WARNING: **All access to this account will be lost.** Any funds held in it will be + /// inaccessible. + /// + /// Requires a `Signed` origin, and the sender account must have been created by a call to + /// `pure` with corresponding parameters. + /// + /// - `spawner`: The account that originally called `pure` to create this account. + /// - `index`: The disambiguation index originally passed to `pure`. Probably `0`. + /// - `proxy_type`: The proxy type originally passed to `pure`. + /// - `height`: The height of the chain when the call to `pure` was processed. + /// - `ext_index`: The extrinsic index in which the call to `pure` was processed. + /// + /// Fails with `NoPermission` in case the caller is not a previously created pure + /// account whose `pure` call has corresponding parameters. _i9.RuntimeCall killPure({ required _i10.MultiAddress spawner, required _i11.ProxyType proxyType, @@ -189,7 +248,21 @@ class Txs { return _i9.RuntimeCall.values.proxy(_call); } - /// See [`Pallet::announce`]. + /// Publish the hash of a proxy-call that will be made in the future. + /// + /// This must be called some number of blocks before the corresponding `proxy` is attempted + /// if the delay associated with the proxy relationship is greater than zero. + /// + /// No more than `MaxPending` announcements may be made at any one time. + /// + /// This will take a deposit of `AnnouncementDepositFactor` as well as + /// `AnnouncementDepositBase` if there are no other pending announcements. + /// + /// The dispatch origin for this call must be _Signed_ and a proxy of `real`. + /// + /// Parameters: + /// - `real`: The account that the proxy will make a call on behalf of. + /// - `call_hash`: The hash of the call to be made by the `real` account. _i9.RuntimeCall announce({ required _i10.MultiAddress real, required _i13.H256 callHash, @@ -201,7 +274,16 @@ class Txs { return _i9.RuntimeCall.values.proxy(_call); } - /// See [`Pallet::remove_announcement`]. + /// Remove a given announcement. + /// + /// May be called by a proxy account to remove a call they previously announced and return + /// the deposit. + /// + /// The dispatch origin for this call must be _Signed_. + /// + /// Parameters: + /// - `real`: The account that the proxy will make a call on behalf of. + /// - `call_hash`: The hash of the call to be made by the `real` account. _i9.RuntimeCall removeAnnouncement({ required _i10.MultiAddress real, required _i13.H256 callHash, @@ -213,7 +295,16 @@ class Txs { return _i9.RuntimeCall.values.proxy(_call); } - /// See [`Pallet::reject_announcement`]. + /// Remove the given announcement of a delegate. + /// + /// May be called by a target (proxied) account to remove a call that one of their delegates + /// (`delegate`) has announced they want to execute. The deposit is returned. + /// + /// The dispatch origin for this call must be _Signed_. + /// + /// Parameters: + /// - `delegate`: The account that previously announced the call. + /// - `call_hash`: The hash of the call to be made. _i9.RuntimeCall rejectAnnouncement({ required _i10.MultiAddress delegate, required _i13.H256 callHash, @@ -225,7 +316,17 @@ class Txs { return _i9.RuntimeCall.values.proxy(_call); } - /// See [`Pallet::proxy_announced`]. + /// Dispatch the given `call` from an account that the sender is authorized for through + /// `add_proxy`. + /// + /// Removes any corresponding announcement(s). + /// + /// The dispatch origin for this call must be _Signed_. + /// + /// Parameters: + /// - `real`: The account that the proxy will make a call on behalf of. + /// - `force_proxy_type`: Specify the exact proxy type to be used and checked for this call. + /// - `call`: The call to be made by the `real` account. _i9.RuntimeCall proxyAnnounced({ required _i10.MultiAddress delegate, required _i10.MultiAddress real, diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/scheduler.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/scheduler.dart index adece6697..f0aa0b61a 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/scheduler.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/scheduler.dart @@ -160,7 +160,7 @@ class Queries { class Txs { const Txs(); - /// See [`Pallet::schedule`]. + /// Anonymously schedule a task. _i8.RuntimeCall schedule({ required int when, _i4.Tuple2? maybePeriodic, @@ -176,7 +176,7 @@ class Txs { return _i8.RuntimeCall.values.scheduler(_call); } - /// See [`Pallet::cancel`]. + /// Cancel an anonymously scheduled task. _i8.RuntimeCall cancel({ required int when, required int index, @@ -188,7 +188,7 @@ class Txs { return _i8.RuntimeCall.values.scheduler(_call); } - /// See [`Pallet::schedule_named`]. + /// Schedule a named task. _i8.RuntimeCall scheduleNamed({ required List id, required int when, @@ -206,13 +206,13 @@ class Txs { return _i8.RuntimeCall.values.scheduler(_call); } - /// See [`Pallet::cancel_named`]. + /// Cancel a named scheduled task. _i8.RuntimeCall cancelNamed({required List id}) { final _call = _i9.Call.values.cancelNamed(id: id); return _i8.RuntimeCall.values.scheduler(_call); } - /// See [`Pallet::schedule_after`]. + /// Anonymously schedule a task after a delay. _i8.RuntimeCall scheduleAfter({ required int after, _i4.Tuple2? maybePeriodic, @@ -228,7 +228,7 @@ class Txs { return _i8.RuntimeCall.values.scheduler(_call); } - /// See [`Pallet::schedule_named_after`]. + /// Schedule a named task after a delay. _i8.RuntimeCall scheduleNamedAfter({ required List id, required int after, @@ -246,7 +246,18 @@ class Txs { return _i8.RuntimeCall.values.scheduler(_call); } - /// See [`Pallet::set_retry`]. + /// Set a retry configuration for a task so that, in case its scheduled run fails, it will + /// be retried after `period` blocks, for a total amount of `retries` retries or until it + /// succeeds. + /// + /// Tasks which need to be scheduled for a retry are still subject to weight metering and + /// agenda space, same as a regular task. If a periodic task fails, it will be scheduled + /// normally while the task is retrying. + /// + /// Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic + /// clones of the original task. Their retry configuration will be derived from the + /// original task's configuration, but will have a lower value for `remaining` than the + /// original `total_retries`. _i8.RuntimeCall setRetry({ required _i4.Tuple2 task, required int retries, @@ -260,7 +271,18 @@ class Txs { return _i8.RuntimeCall.values.scheduler(_call); } - /// See [`Pallet::set_retry_named`]. + /// Set a retry configuration for a named task so that, in case its scheduled run fails, it + /// will be retried after `period` blocks, for a total amount of `retries` retries or until + /// it succeeds. + /// + /// Tasks which need to be scheduled for a retry are still subject to weight metering and + /// agenda space, same as a regular task. If a periodic task fails, it will be scheduled + /// normally while the task is retrying. + /// + /// Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic + /// clones of the original task. Their retry configuration will be derived from the + /// original task's configuration, but will have a lower value for `remaining` than the + /// original `total_retries`. _i8.RuntimeCall setRetryNamed({ required List id, required int retries, @@ -274,13 +296,13 @@ class Txs { return _i8.RuntimeCall.values.scheduler(_call); } - /// See [`Pallet::cancel_retry`]. + /// Removes the retry configuration of a task. _i8.RuntimeCall cancelRetry({required _i4.Tuple2 task}) { final _call = _i9.Call.values.cancelRetry(task: task); return _i8.RuntimeCall.values.scheduler(_call); } - /// See [`Pallet::cancel_retry_named`]. + /// Cancel the retry configuration of a named task. _i8.RuntimeCall cancelRetryNamed({required List id}) { final _call = _i9.Call.values.cancelRetryNamed(id: id); return _i8.RuntimeCall.values.scheduler(_call); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/sudo.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/sudo.dart index 977b3697f..fd6f8cc8a 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/sudo.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/sudo.dart @@ -44,13 +44,17 @@ class Queries { class Txs { const Txs(); - /// See [`Pallet::sudo`]. + /// Authenticates the sudo key and dispatches a function call with `Root` origin. _i5.RuntimeCall sudo({required _i5.RuntimeCall call}) { final _call = _i6.Call.values.sudo(call: call); return _i5.RuntimeCall.values.sudo(_call); } - /// See [`Pallet::sudo_unchecked_weight`]. + /// Authenticates the sudo key and dispatches a function call with `Root` origin. + /// This function does not check the weight of the call, and instead allows the + /// Sudo user to specify the weight of the call. + /// + /// The dispatch origin for this call must be _Signed_. _i5.RuntimeCall sudoUncheckedWeight({ required _i5.RuntimeCall call, required _i7.Weight weight, @@ -62,13 +66,17 @@ class Txs { return _i5.RuntimeCall.values.sudo(_call); } - /// See [`Pallet::set_key`]. + /// Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo + /// key. _i5.RuntimeCall setKey({required _i8.MultiAddress new_}) { final _call = _i6.Call.values.setKey(new_: new_); return _i5.RuntimeCall.values.sudo(_call); } - /// See [`Pallet::sudo_as`]. + /// Authenticates the sudo key and dispatches a function call with `Signed` origin from + /// a given account. + /// + /// The dispatch origin for this call must be _Signed_. _i5.RuntimeCall sudoAs({ required _i8.MultiAddress who, required _i5.RuntimeCall call, @@ -80,7 +88,9 @@ class Txs { return _i5.RuntimeCall.values.sudo(_call); } - /// See [`Pallet::remove_key`]. + /// Permanently removes the sudo key. + /// + /// **This cannot be un-done.** _i5.RuntimeCall removeKey() { final _call = _i6.Call.values.removeKey(); return _i5.RuntimeCall.values.sudo(_call); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/system.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/system.dart index e674167d3..e46897441 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/system.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/system.dart @@ -46,6 +46,12 @@ class Queries { valueCodec: _i4.U32Codec.codec, ); + final _i1.StorageValue _inherentsApplied = const _i1.StorageValue( + prefix: 'System', + storage: 'InherentsApplied', + valueCodec: _i4.BoolCodec.codec, + ); + final _i1.StorageValue<_i5.PerDispatchClass> _blockWeight = const _i1.StorageValue<_i5.PerDispatchClass>( prefix: 'System', storage: 'BlockWeight', @@ -188,6 +194,19 @@ class Queries { return null; /* Nullable */ } + /// Whether all inherents have been applied. + _i13.Future inherentsApplied({_i1.BlockHash? at}) async { + final hashedKey = _inherentsApplied.hashedKey(); + final bytes = await __api.getStorage( + hashedKey, + at: at, + ); + if (bytes != null) { + return _inherentsApplied.decodeValue(bytes); + } + return false; /* Default */ + } + /// The current weight for the block. _i13.Future<_i5.PerDispatchClass> blockWeight({_i1.BlockHash? at}) async { final hashedKey = _blockWeight.hashedKey(); @@ -445,6 +464,12 @@ class Queries { return hashedKey; } + /// Returns the storage key for `inherentsApplied`. + _i16.Uint8List inherentsAppliedKey() { + final hashedKey = _inherentsApplied.hashedKey(); + return hashedKey; + } + /// Returns the storage key for `blockWeight`. _i16.Uint8List blockWeightKey() { final hashedKey = _blockWeight.hashedKey(); @@ -563,43 +588,51 @@ class Queries { class Txs { const Txs(); - /// See [`Pallet::remark`]. + /// Make some on-chain remark. + /// + /// Can be executed by every `origin`. _i17.RuntimeCall remark({required List remark}) { final _call = _i18.Call.values.remark(remark: remark); return _i17.RuntimeCall.values.system(_call); } - /// See [`Pallet::set_heap_pages`]. + /// Set the number of pages in the WebAssembly environment's heap. _i17.RuntimeCall setHeapPages({required BigInt pages}) { final _call = _i18.Call.values.setHeapPages(pages: pages); return _i17.RuntimeCall.values.system(_call); } - /// See [`Pallet::set_code`]. + /// Set the new runtime code. _i17.RuntimeCall setCode({required List code}) { final _call = _i18.Call.values.setCode(code: code); return _i17.RuntimeCall.values.system(_call); } - /// See [`Pallet::set_code_without_checks`]. + /// Set the new runtime code without doing any checks of the given `code`. + /// + /// Note that runtime upgrades will not run if this is called with a not-increasing spec + /// version! _i17.RuntimeCall setCodeWithoutChecks({required List code}) { final _call = _i18.Call.values.setCodeWithoutChecks(code: code); return _i17.RuntimeCall.values.system(_call); } - /// See [`Pallet::set_storage`]. + /// Set some items of storage. _i17.RuntimeCall setStorage({required List<_i9.Tuple2, List>> items}) { final _call = _i18.Call.values.setStorage(items: items); return _i17.RuntimeCall.values.system(_call); } - /// See [`Pallet::kill_storage`]. + /// Kill some items from storage. _i17.RuntimeCall killStorage({required List> keys}) { final _call = _i18.Call.values.killStorage(keys: keys); return _i17.RuntimeCall.values.system(_call); } - /// See [`Pallet::kill_prefix`]. + /// Kill all storage items with a key that starts with the given prefix. + /// + /// **NOTE:** We rely on the Root origin to provide us the number of subkeys under + /// the prefix we are removing to accurately calculate the weight of this function. _i17.RuntimeCall killPrefix({ required List prefix, required int subkeys, @@ -611,25 +644,43 @@ class Txs { return _i17.RuntimeCall.values.system(_call); } - /// See [`Pallet::remark_with_event`]. + /// Make some on-chain remark and emit event. _i17.RuntimeCall remarkWithEvent({required List remark}) { final _call = _i18.Call.values.remarkWithEvent(remark: remark); return _i17.RuntimeCall.values.system(_call); } - /// See [`Pallet::authorize_upgrade`]. + /// Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied + /// later. + /// + /// This call requires Root origin. _i17.RuntimeCall authorizeUpgrade({required _i6.H256 codeHash}) { final _call = _i18.Call.values.authorizeUpgrade(codeHash: codeHash); return _i17.RuntimeCall.values.system(_call); } - /// See [`Pallet::authorize_upgrade_without_checks`]. + /// Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied + /// later. + /// + /// WARNING: This authorizes an upgrade that will take place without any safety checks, for + /// example that the spec name remains the same and that the version number increases. Not + /// recommended for normal use. Use `authorize_upgrade` instead. + /// + /// This call requires Root origin. _i17.RuntimeCall authorizeUpgradeWithoutChecks({required _i6.H256 codeHash}) { final _call = _i18.Call.values.authorizeUpgradeWithoutChecks(codeHash: codeHash); return _i17.RuntimeCall.values.system(_call); } - /// See [`Pallet::apply_authorized_upgrade`]. + /// Provide the preimage (runtime binary) `code` for an upgrade that has been authorized. + /// + /// If the authorization required a version check, this call will ensure the spec name + /// remains unchanged and that the spec version has increased. + /// + /// Depending on the runtime's `OnSetCode` configuration, this function may directly apply + /// the new `code` in the same block or attempt to schedule the upgrade. + /// + /// All origins are allowed. _i17.RuntimeCall applyAuthorizedUpgrade({required List code}) { final _call = _i18.Call.values.applyAuthorizedUpgrade(code: code); return _i17.RuntimeCall.values.system(_call); @@ -642,7 +693,7 @@ class Constants { /// Block & extrinsics weights: base values and limits. final _i19.BlockWeights blockWeights = _i19.BlockWeights( baseBlock: _i15.Weight( - refTime: BigInt.from(390584000), + refTime: BigInt.from(453383000), proofSize: BigInt.zero, ), maxBlock: _i15.Weight( @@ -655,11 +706,11 @@ class Constants { perClass: _i20.PerDispatchClass( normal: _i21.WeightsPerClass( baseExtrinsic: _i15.Weight( - refTime: BigInt.from(124414000), + refTime: BigInt.from(107074000), proofSize: BigInt.zero, ), maxExtrinsic: _i15.Weight( - refTime: BigInt.from(1299875586000), + refTime: BigInt.from(1299892926000), proofSize: BigInt.parse( '11990383647911208550', radix: 10, @@ -679,11 +730,11 @@ class Constants { ), operational: _i21.WeightsPerClass( baseExtrinsic: _i15.Weight( - refTime: BigInt.from(124414000), + refTime: BigInt.from(107074000), proofSize: BigInt.zero, ), maxExtrinsic: _i15.Weight( - refTime: BigInt.from(1799875586000), + refTime: BigInt.from(1799892926000), proofSize: BigInt.parse( '16602069666338596454', radix: 10, @@ -706,7 +757,7 @@ class Constants { ), mandatory: _i21.WeightsPerClass( baseExtrinsic: _i15.Weight( - refTime: BigInt.from(124414000), + refTime: BigInt.from(107074000), proofSize: BigInt.zero, ), maxExtrinsic: null, @@ -733,12 +784,12 @@ class Constants { write: BigInt.from(100000000), ); - /// Get the chain's current version. + /// Get the chain's in-code version. final _i25.RuntimeVersion version = const _i25.RuntimeVersion( specName: 'encointer-node-notee', implName: 'encointer-node-notee', authoringVersion: 0, - specVersion: 32, + specVersion: 361, implVersion: 0, apis: [ _i9.Tuple2, int>( @@ -752,7 +803,7 @@ class Constants { 96, 155, ], - 4, + 5, ), _i9.Tuple2, int>( [ @@ -949,6 +1000,19 @@ class Constants { ], 1, ), + _i9.Tuple2, int>( + [ + 123, + 79, + 66, + 162, + 91, + 118, + 252, + 21, + ], + 1, + ), ], transactionVersion: 5, stateVersion: 0, diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/timestamp.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/timestamp.dart index 6be00e196..de2b180c2 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/timestamp.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/timestamp.dart @@ -70,7 +70,25 @@ class Queries { class Txs { const Txs(); - /// See [`Pallet::set`]. + /// Set the current time. + /// + /// This call should be invoked exactly once per block. It will panic at the finalization + /// phase, if this call hasn't been invoked by that time. + /// + /// The timestamp should be greater than the previous one by the amount specified by + /// [`Config::MinimumPeriod`]. + /// + /// The dispatch origin for this call must be _None_. + /// + /// This dispatch class is _Mandatory_ to ensure it gets executed in the block. Be aware + /// that changing the complexity of this call could result exhausting the resources in a + /// block to execute any other calls. + /// + /// ## Complexity + /// - `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`) + /// - 1 storage read and 1 storage mutation (codec `O(1)` because of `DidUpdate::take` in + /// `on_finalize`) + /// - 1 event handler `on_timestamp_set`. Must be `O(1)`. _i5.RuntimeCall set({required BigInt now}) { final _call = _i6.Call.values.set(now: now); return _i5.RuntimeCall.values.timestamp(_call); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/treasury.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/treasury.dart index 190d6e732..51aae41d5 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/treasury.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/treasury.dart @@ -197,31 +197,23 @@ class Queries { class Txs { const Txs(); - /// See [`Pallet::propose_spend`]. - _i7.RuntimeCall proposeSpend({ - required BigInt value, - required _i8.MultiAddress beneficiary, - }) { - final _call = _i9.Call.values.proposeSpend( - value: value, - beneficiary: beneficiary, - ); - return _i7.RuntimeCall.values.treasury(_call); - } - - /// See [`Pallet::reject_proposal`]. - _i7.RuntimeCall rejectProposal({required BigInt proposalId}) { - final _call = _i9.Call.values.rejectProposal(proposalId: proposalId); - return _i7.RuntimeCall.values.treasury(_call); - } - - /// See [`Pallet::approve_proposal`]. - _i7.RuntimeCall approveProposal({required BigInt proposalId}) { - final _call = _i9.Call.values.approveProposal(proposalId: proposalId); - return _i7.RuntimeCall.values.treasury(_call); - } - - /// See [`Pallet::spend_local`]. + /// Propose and approve a spend of treasury funds. + /// + /// ## Dispatch Origin + /// + /// Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`. + /// + /// ### Details + /// NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the + /// beneficiary. + /// + /// ### Parameters + /// - `amount`: The amount to be transferred from the treasury to the `beneficiary`. + /// - `beneficiary`: The destination account for the transfer. + /// + /// ## Events + /// + /// Emits [`Event::SpendApproved`] if successful. _i7.RuntimeCall spendLocal({ required BigInt amount, required _i8.MultiAddress beneficiary, @@ -233,13 +225,58 @@ class Txs { return _i7.RuntimeCall.values.treasury(_call); } - /// See [`Pallet::remove_approval`]. + /// Force a previously approved proposal to be removed from the approval queue. + /// + /// ## Dispatch Origin + /// + /// Must be [`Config::RejectOrigin`]. + /// + /// ## Details + /// + /// The original deposit will no longer be returned. + /// + /// ### Parameters + /// - `proposal_id`: The index of a proposal + /// + /// ### Complexity + /// - O(A) where `A` is the number of approvals + /// + /// ### Errors + /// - [`Error::ProposalNotApproved`]: The `proposal_id` supplied was not found in the + /// approval queue, i.e., the proposal has not been approved. This could also mean the + /// proposal does not exist altogether, thus there is no way it would have been approved + /// in the first place. _i7.RuntimeCall removeApproval({required BigInt proposalId}) { final _call = _i9.Call.values.removeApproval(proposalId: proposalId); return _i7.RuntimeCall.values.treasury(_call); } - /// See [`Pallet::spend`]. + /// Propose and approve a spend of treasury funds. + /// + /// ## Dispatch Origin + /// + /// Must be [`Config::SpendOrigin`] with the `Success` value being at least + /// `amount` of `asset_kind` in the native asset. The amount of `asset_kind` is converted + /// for assertion using the [`Config::BalanceConverter`]. + /// + /// ## Details + /// + /// Create an approved spend for transferring a specific `amount` of `asset_kind` to a + /// designated beneficiary. The spend must be claimed using the `payout` dispatchable within + /// the [`Config::PayoutPeriod`]. + /// + /// ### Parameters + /// - `asset_kind`: An indicator of the specific asset class to be spent. + /// - `amount`: The amount to be transferred from the treasury to the `beneficiary`. + /// - `beneficiary`: The beneficiary of the spend. + /// - `valid_from`: The block number from which the spend can be claimed. It can refer to + /// the past if the resulting spend has not yet expired according to the + /// [`Config::PayoutPeriod`]. If `None`, the spend can be claimed immediately after + /// approval. + /// + /// ## Events + /// + /// Emits [`Event::AssetSpendApproved`] if successful. _i7.RuntimeCall spend({ required dynamic assetKind, required BigInt amount, @@ -255,19 +292,70 @@ class Txs { return _i7.RuntimeCall.values.treasury(_call); } - /// See [`Pallet::payout`]. + /// Claim a spend. + /// + /// ## Dispatch Origin + /// + /// Must be signed + /// + /// ## Details + /// + /// Spends must be claimed within some temporal bounds. A spend may be claimed within one + /// [`Config::PayoutPeriod`] from the `valid_from` block. + /// In case of a payout failure, the spend status must be updated with the `check_status` + /// dispatchable before retrying with the current function. + /// + /// ### Parameters + /// - `index`: The spend index. + /// + /// ## Events + /// + /// Emits [`Event::Paid`] if successful. _i7.RuntimeCall payout({required int index}) { final _call = _i9.Call.values.payout(index: index); return _i7.RuntimeCall.values.treasury(_call); } - /// See [`Pallet::check_status`]. + /// Check the status of the spend and remove it from the storage if processed. + /// + /// ## Dispatch Origin + /// + /// Must be signed. + /// + /// ## Details + /// + /// The status check is a prerequisite for retrying a failed payout. + /// If a spend has either succeeded or expired, it is removed from the storage by this + /// function. In such instances, transaction fees are refunded. + /// + /// ### Parameters + /// - `index`: The spend index. + /// + /// ## Events + /// + /// Emits [`Event::PaymentFailed`] if the spend payout has failed. + /// Emits [`Event::SpendProcessed`] if the spend payout has succeed. _i7.RuntimeCall checkStatus({required int index}) { final _call = _i9.Call.values.checkStatus(index: index); return _i7.RuntimeCall.values.treasury(_call); } - /// See [`Pallet::void_spend`]. + /// Void previously approved spend. + /// + /// ## Dispatch Origin + /// + /// Must be [`Config::RejectOrigin`]. + /// + /// ## Details + /// + /// A spend void is only possible if the payout has not been attempted yet. + /// + /// ### Parameters + /// - `index`: The spend index. + /// + /// ## Events + /// + /// Emits [`Event::AssetSpendVoided`] if successful. _i7.RuntimeCall voidSpend({required int index}) { final _call = _i9.Call.values.voidSpend(index: index); return _i7.RuntimeCall.values.treasury(_call); @@ -277,16 +365,6 @@ class Txs { class Constants { Constants(); - /// Fraction of a proposal's value that should be bonded in order to place the proposal. - /// An accepted proposal gets these back. A rejected proposal does not. - final _i11.Permill proposalBond = 50000; - - /// Minimum amount of funds that should be placed in a deposit for making a proposal. - final BigInt proposalBondMinimum = BigInt.from(100000000000); - - /// Maximum amount of funds that should be placed in a deposit for making a proposal. - final BigInt? proposalBondMaximum = BigInt.from(500000000000000); - /// Period between successive spends. final int spendPeriod = 86400; diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/utility.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/utility.dart index d380081f1..fe7b5ab23 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/utility.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/utility.dart @@ -7,13 +7,42 @@ import '../types/sp_weights/weight_v2/weight.dart' as _i4; class Txs { const Txs(); - /// See [`Pallet::batch`]. + /// Send a batch of dispatch calls. + /// + /// May be called from any origin except `None`. + /// + /// - `calls`: The calls to be dispatched from the same origin. The number of call must not + /// exceed the constant: `batched_calls_limit` (available in constant metadata). + /// + /// If origin is root then the calls are dispatched without checking origin filter. (This + /// includes bypassing `frame_system::Config::BaseCallFilter`). + /// + /// ## Complexity + /// - O(C) where C is the number of calls to be batched. + /// + /// This will return `Ok` in all circumstances. To determine the success of the batch, an + /// event is deposited. If a call failed and the batch was interrupted, then the + /// `BatchInterrupted` event is deposited, along with the number of successful calls made + /// and the error of the failed call. If all were successful, then the `BatchCompleted` + /// event is deposited. _i1.RuntimeCall batch({required List<_i1.RuntimeCall> calls}) { final _call = _i2.Call.values.batch(calls: calls); return _i1.RuntimeCall.values.utility(_call); } - /// See [`Pallet::as_derivative`]. + /// Send a call through an indexed pseudonym of the sender. + /// + /// Filter from origin are passed along. The call will be dispatched with an origin which + /// use the same filter as the origin of this call. + /// + /// NOTE: If you need to ensure that any account-based filtering is not honored (i.e. + /// because you expect `proxy` to have been used prior in the call stack and you do not want + /// the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1` + /// in the Multisig pallet instead. + /// + /// NOTE: Prior to version *12, this was called `as_limited_sub`. + /// + /// The dispatch origin for this call must be _Signed_. _i1.RuntimeCall asDerivative({ required int index, required _i1.RuntimeCall call, @@ -25,13 +54,30 @@ class Txs { return _i1.RuntimeCall.values.utility(_call); } - /// See [`Pallet::batch_all`]. + /// Send a batch of dispatch calls and atomically execute them. + /// The whole transaction will rollback and fail if any of the calls failed. + /// + /// May be called from any origin except `None`. + /// + /// - `calls`: The calls to be dispatched from the same origin. The number of call must not + /// exceed the constant: `batched_calls_limit` (available in constant metadata). + /// + /// If origin is root then the calls are dispatched without checking origin filter. (This + /// includes bypassing `frame_system::Config::BaseCallFilter`). + /// + /// ## Complexity + /// - O(C) where C is the number of calls to be batched. _i1.RuntimeCall batchAll({required List<_i1.RuntimeCall> calls}) { final _call = _i2.Call.values.batchAll(calls: calls); return _i1.RuntimeCall.values.utility(_call); } - /// See [`Pallet::dispatch_as`]. + /// Dispatches a function call with a provided origin. + /// + /// The dispatch origin for this call must be _Root_. + /// + /// ## Complexity + /// - O(1). _i1.RuntimeCall dispatchAs({ required _i3.OriginCaller asOrigin, required _i1.RuntimeCall call, @@ -43,13 +89,30 @@ class Txs { return _i1.RuntimeCall.values.utility(_call); } - /// See [`Pallet::force_batch`]. + /// Send a batch of dispatch calls. + /// Unlike `batch`, it allows errors and won't interrupt. + /// + /// May be called from any origin except `None`. + /// + /// - `calls`: The calls to be dispatched from the same origin. The number of call must not + /// exceed the constant: `batched_calls_limit` (available in constant metadata). + /// + /// If origin is root then the calls are dispatch without checking origin filter. (This + /// includes bypassing `frame_system::Config::BaseCallFilter`). + /// + /// ## Complexity + /// - O(C) where C is the number of calls to be batched. _i1.RuntimeCall forceBatch({required List<_i1.RuntimeCall> calls}) { final _call = _i2.Call.values.forceBatch(calls: calls); return _i1.RuntimeCall.values.utility(_call); } - /// See [`Pallet::with_weight`]. + /// Dispatch a function call with a specified weight. + /// + /// This function does not check the weight of the call, and instead allows the + /// Root origin to specify the weight of the call. + /// + /// The dispatch origin for this call must be _Root_. _i1.RuntimeCall withWeight({ required _i1.RuntimeCall call, required _i4.Weight weight, diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_node_notee_runtime/runtime_event.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_node_notee_runtime/runtime_event.dart index 91a01f124..8ea725c1a 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_node_notee_runtime/runtime_event.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_node_notee_runtime/runtime_event.dart @@ -14,6 +14,7 @@ import '../pallet_encointer_democracy/pallet/event.dart' as _i20; import '../pallet_encointer_faucet/pallet/event.dart' as _i19; import '../pallet_encointer_reputation_commitments/pallet/event.dart' as _i18; import '../pallet_encointer_scheduler/pallet/event.dart' as _i13; +import '../pallet_encointer_treasuries/pallet/event.dart' as _i21; import '../pallet_grandpa/pallet/event.dart' as _i8; import '../pallet_proxy/pallet/event.dart' as _i10; import '../pallet_scheduler/pallet/event.dart' as _i11; @@ -120,6 +121,10 @@ class $RuntimeEvent { EncointerDemocracy encointerDemocracy(_i20.Event value0) { return EncointerDemocracy(value0); } + + EncointerTreasuries encointerTreasuries(_i21.Event value0) { + return EncointerTreasuries(value0); + } } class $RuntimeEventCodec with _i1.Codec { @@ -165,6 +170,8 @@ class $RuntimeEventCodec with _i1.Codec { return EncointerFaucet._decode(input); case 67: return EncointerDemocracy._decode(input); + case 68: + return EncointerTreasuries._decode(input); default: throw Exception('RuntimeEvent: Invalid variant index: "$index"'); } @@ -230,6 +237,9 @@ class $RuntimeEventCodec with _i1.Codec { case EncointerDemocracy: (value as EncointerDemocracy).encodeTo(output); break; + case EncointerTreasuries: + (value as EncointerTreasuries).encodeTo(output); + break; default: throw Exception('RuntimeEvent: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -274,6 +284,8 @@ class $RuntimeEventCodec with _i1.Codec { return (value as EncointerFaucet)._sizeHint(); case EncointerDemocracy: return (value as EncointerDemocracy)._sizeHint(); + case EncointerTreasuries: + return (value as EncointerTreasuries)._sizeHint(); default: throw Exception('RuntimeEvent: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -1035,3 +1047,45 @@ class EncointerDemocracy extends RuntimeEvent { @override int get hashCode => value0.hashCode; } + +class EncointerTreasuries extends RuntimeEvent { + const EncointerTreasuries(this.value0); + + factory EncointerTreasuries._decode(_i1.Input input) { + return EncointerTreasuries(_i21.Event.codec.decode(input)); + } + + /// pallet_encointer_treasuries::Event + final _i21.Event value0; + + @override + Map>> toJson() => {'EncointerTreasuries': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i21.Event.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 68, + output, + ); + _i21.Event.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is EncointerTreasuries && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/democracy/proposal.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/democracy/proposal.dart index 3f4742555..2dbe5e758 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/democracy/proposal.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/democracy/proposal.dart @@ -25,7 +25,7 @@ class Proposal { /// CeremonyIndexType final int startCindex; - /// ProposalAction + /// ProposalAction final _i2.ProposalAction action; /// ProposalState diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/democracy/proposal_action.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/democracy/proposal_action.dart index 4d111f862..0faf8b2cf 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/democracy/proposal_action.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/democracy/proposal_action.dart @@ -2,7 +2,9 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i9; +import '../../sp_core/crypto/account_id32.dart' as _i8; import '../../substrate_fixed/fixed_i128.dart' as _i6; import '../../substrate_fixed/fixed_u128.dart' as _i7; import '../communities/community_identifier.dart' as _i3; @@ -89,6 +91,28 @@ class $ProposalAction { SetInactivityTimeout setInactivityTimeout(int value0) { return SetInactivityTimeout(value0); } + + Petition petition( + _i3.CommunityIdentifier? value0, + List value1, + ) { + return Petition( + value0, + value1, + ); + } + + SpendNative spendNative( + _i3.CommunityIdentifier? value0, + _i8.AccountId32 value1, + BigInt value2, + ) { + return SpendNative( + value0, + value1, + value2, + ); + } } class $ProposalActionCodec with _i1.Codec { @@ -110,6 +134,10 @@ class $ProposalActionCodec with _i1.Codec { return UpdateNominalIncome._decode(input); case 5: return SetInactivityTimeout._decode(input); + case 6: + return Petition._decode(input); + case 7: + return SpendNative._decode(input); default: throw Exception('ProposalAction: Invalid variant index: "$index"'); } @@ -139,6 +167,12 @@ class $ProposalActionCodec with _i1.Codec { case SetInactivityTimeout: (value as SetInactivityTimeout).encodeTo(output); break; + case Petition: + (value as Petition).encodeTo(output); + break; + case SpendNative: + (value as SpendNative).encodeTo(output); + break; default: throw Exception('ProposalAction: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -159,6 +193,10 @@ class $ProposalActionCodec with _i1.Codec { return (value as UpdateNominalIncome)._sizeHint(); case SetInactivityTimeout: return (value as SetInactivityTimeout)._sizeHint(); + case Petition: + return (value as Petition)._sizeHint(); + case SpendNative: + return (value as SpendNative)._sizeHint(); default: throw Exception('ProposalAction: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -526,3 +564,154 @@ class SetInactivityTimeout extends ProposalAction { @override int get hashCode => value0.hashCode; } + +class Petition extends ProposalAction { + const Petition( + this.value0, + this.value1, + ); + + factory Petition._decode(_i1.Input input) { + return Petition( + const _i1.OptionCodec<_i3.CommunityIdentifier>(_i3.CommunityIdentifier.codec).decode(input), + _i1.U8SequenceCodec.codec.decode(input), + ); + } + + /// Option + final _i3.CommunityIdentifier? value0; + + /// PalletString + final List value1; + + @override + Map> toJson() => { + 'Petition': [ + value0?.toJson(), + value1, + ] + }; + + int _sizeHint() { + int size = 1; + size = size + const _i1.OptionCodec<_i3.CommunityIdentifier>(_i3.CommunityIdentifier.codec).sizeHint(value0); + size = size + _i1.U8SequenceCodec.codec.sizeHint(value1); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 6, + output, + ); + const _i1.OptionCodec<_i3.CommunityIdentifier>(_i3.CommunityIdentifier.codec).encodeTo( + value0, + output, + ); + _i1.U8SequenceCodec.codec.encodeTo( + value1, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Petition && + other.value0 == value0 && + _i9.listsEqual( + other.value1, + value1, + ); + + @override + int get hashCode => Object.hash( + value0, + value1, + ); +} + +class SpendNative extends ProposalAction { + const SpendNative( + this.value0, + this.value1, + this.value2, + ); + + factory SpendNative._decode(_i1.Input input) { + return SpendNative( + const _i1.OptionCodec<_i3.CommunityIdentifier>(_i3.CommunityIdentifier.codec).decode(input), + const _i1.U8ArrayCodec(32).decode(input), + _i1.U128Codec.codec.decode(input), + ); + } + + /// Option + final _i3.CommunityIdentifier? value0; + + /// AccountId + final _i8.AccountId32 value1; + + /// Balance + final BigInt value2; + + @override + Map> toJson() => { + 'SpendNative': [ + value0?.toJson(), + value1.toList(), + value2, + ] + }; + + int _sizeHint() { + int size = 1; + size = size + const _i1.OptionCodec<_i3.CommunityIdentifier>(_i3.CommunityIdentifier.codec).sizeHint(value0); + size = size + const _i8.AccountId32Codec().sizeHint(value1); + size = size + _i1.U128Codec.codec.sizeHint(value2); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 7, + output, + ); + const _i1.OptionCodec<_i3.CommunityIdentifier>(_i3.CommunityIdentifier.codec).encodeTo( + value0, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + value1, + output, + ); + _i1.U128Codec.codec.encodeTo( + value2, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is SpendNative && + other.value0 == value0 && + _i9.listsEqual( + other.value1, + value1, + ) && + other.value2 == value2; + + @override + int get hashCode => Object.hash( + value0, + value1, + value2, + ); +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/democracy/proposal_action_identifier.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/democracy/proposal_action_identifier.dart index a36650f76..f248801e4 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/democracy/proposal_action_identifier.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/democracy/proposal_action_identifier.dart @@ -55,6 +55,14 @@ class $ProposalActionIdentifier { SetInactivityTimeout setInactivityTimeout() { return SetInactivityTimeout(); } + + Petition petition(_i3.CommunityIdentifier? value0) { + return Petition(value0); + } + + SpendNative spendNative(_i3.CommunityIdentifier? value0) { + return SpendNative(value0); + } } class $ProposalActionIdentifierCodec with _i1.Codec { @@ -76,6 +84,10 @@ class $ProposalActionIdentifierCodec with _i1.Codec { return UpdateNominalIncome._decode(input); case 5: return const SetInactivityTimeout(); + case 6: + return Petition._decode(input); + case 7: + return SpendNative._decode(input); default: throw Exception('ProposalActionIdentifier: Invalid variant index: "$index"'); } @@ -105,6 +117,12 @@ class $ProposalActionIdentifierCodec with _i1.Codec { case SetInactivityTimeout: (value as SetInactivityTimeout).encodeTo(output); break; + case Petition: + (value as Petition).encodeTo(output); + break; + case SpendNative: + (value as SpendNative).encodeTo(output); + break; default: throw Exception('ProposalActionIdentifier: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -125,6 +143,10 @@ class $ProposalActionIdentifierCodec with _i1.Codec { return (value as UpdateNominalIncome)._sizeHint(); case SetInactivityTimeout: return 1; + case Petition: + return (value as Petition)._sizeHint(); + case SpendNative: + return (value as SpendNative)._sizeHint(); default: throw Exception('ProposalActionIdentifier: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -360,3 +382,87 @@ class SetInactivityTimeout extends ProposalActionIdentifier { @override int get hashCode => runtimeType.hashCode; } + +class Petition extends ProposalActionIdentifier { + const Petition(this.value0); + + factory Petition._decode(_i1.Input input) { + return Petition(const _i1.OptionCodec<_i3.CommunityIdentifier>(_i3.CommunityIdentifier.codec).decode(input)); + } + + /// Option + final _i3.CommunityIdentifier? value0; + + @override + Map>?> toJson() => {'Petition': value0?.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + const _i1.OptionCodec<_i3.CommunityIdentifier>(_i3.CommunityIdentifier.codec).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 6, + output, + ); + const _i1.OptionCodec<_i3.CommunityIdentifier>(_i3.CommunityIdentifier.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Petition && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class SpendNative extends ProposalActionIdentifier { + const SpendNative(this.value0); + + factory SpendNative._decode(_i1.Input input) { + return SpendNative(const _i1.OptionCodec<_i3.CommunityIdentifier>(_i3.CommunityIdentifier.codec).decode(input)); + } + + /// Option + final _i3.CommunityIdentifier? value0; + + @override + Map>?> toJson() => {'SpendNative': value0?.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + const _i1.OptionCodec<_i3.CommunityIdentifier>(_i3.CommunityIdentifier.codec).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 7, + output, + ); + const _i1.OptionCodec<_i3.CommunityIdentifier>(_i3.CommunityIdentifier.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is SpendNative && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/democracy/proposal_state.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/democracy/proposal_state.dart index d3de6e658..dbd7ae855 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/democracy/proposal_state.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/democracy/proposal_state.dart @@ -94,12 +94,12 @@ class $ProposalStateCodec with _i1.Codec { case Approved: (value as Approved).encodeTo(output); break; - case Rejected: - (value as Rejected).encodeTo(output); - break; case SupersededBy: (value as SupersededBy).encodeTo(output); break; + case Rejected: + (value as Rejected).encodeTo(output); + break; case Enacted: (value as Enacted).encodeTo(output); break; @@ -117,9 +117,9 @@ class $ProposalStateCodec with _i1.Codec { return (value as Confirming)._sizeHint(); case Approved: return 1; - case Rejected: - return 1; case SupersededBy: + return (value as SupersededBy)._sizeHint(); + case Rejected: return 1; case Enacted: return 1; @@ -220,7 +220,7 @@ class SupersededBy extends ProposalState { return SupersededBy(id: _i1.U128Codec.codec.decode(input)); } - /// Moment + /// ProposalIdType final BigInt id; @override @@ -228,6 +228,12 @@ class SupersededBy extends ProposalState { 'SupersededBy': {'id': id} }; + int _sizeHint() { + int size = 1; + size = size + _i1.U128Codec.codec.sizeHint(id); + return size; + } + void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( 3, diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/finality_grandpa/equivocation_1.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/finality_grandpa/equivocation_1.dart index 7341b45ba..675ba063d 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/finality_grandpa/equivocation_1.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/finality_grandpa/equivocation_1.dart @@ -2,6 +2,7 @@ import 'dart:typed_data' as _i6; import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i7; import '../sp_consensus_grandpa/app/public.dart' as _i2; import '../sp_consensus_grandpa/app/signature.dart' as _i5; @@ -59,7 +60,10 @@ class Equivocation { ) || other is Equivocation && other.roundNumber == roundNumber && - other.identity == identity && + _i7.listsEqual( + other.identity, + identity, + ) && other.first == first && other.second == second; diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/finality_grandpa/equivocation_2.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/finality_grandpa/equivocation_2.dart index 0f3d42128..b46651400 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/finality_grandpa/equivocation_2.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/finality_grandpa/equivocation_2.dart @@ -2,6 +2,7 @@ import 'dart:typed_data' as _i6; import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i7; import '../sp_consensus_grandpa/app/public.dart' as _i2; import '../sp_consensus_grandpa/app/signature.dart' as _i5; @@ -59,7 +60,10 @@ class Equivocation { ) || other is Equivocation && other.roundNumber == roundNumber && - other.identity == identity && + _i7.listsEqual( + other.identity, + identity, + ) && other.first == first && other.second == second; diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_metadata_hash_extension/check_metadata_hash.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_metadata_hash_extension/check_metadata_hash.dart new file mode 100644 index 000000000..59209324c --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_metadata_hash_extension/check_metadata_hash.dart @@ -0,0 +1,63 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i3; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import 'mode.dart' as _i2; + +class CheckMetadataHash { + const CheckMetadataHash({required this.mode}); + + factory CheckMetadataHash.decode(_i1.Input input) { + return codec.decode(input); + } + + /// Mode + final _i2.Mode mode; + + static const $CheckMetadataHashCodec codec = $CheckMetadataHashCodec(); + + _i3.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => {'mode': mode.toJson()}; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is CheckMetadataHash && other.mode == mode; + + @override + int get hashCode => mode.hashCode; +} + +class $CheckMetadataHashCodec with _i1.Codec { + const $CheckMetadataHashCodec(); + + @override + void encodeTo( + CheckMetadataHash obj, + _i1.Output output, + ) { + _i2.Mode.codec.encodeTo( + obj.mode, + output, + ); + } + + @override + CheckMetadataHash decode(_i1.Input input) { + return CheckMetadataHash(mode: _i2.Mode.codec.decode(input)); + } + + @override + int sizeHint(CheckMetadataHash obj) { + int size = 0; + size = size + _i2.Mode.codec.sizeHint(obj.mode); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_metadata_hash_extension/mode.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_metadata_hash_extension/mode.dart new file mode 100644 index 000000000..4a4dd4c77 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_metadata_hash_extension/mode.dart @@ -0,0 +1,57 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +enum Mode { + disabled('Disabled', 0), + enabled('Enabled', 1); + + const Mode( + this.variantName, + this.codecIndex, + ); + + factory Mode.decode(_i1.Input input) { + return codec.decode(input); + } + + final String variantName; + + final int codecIndex; + + static const $ModeCodec codec = $ModeCodec(); + + String toJson() => variantName; + _i2.Uint8List encode() { + return codec.encode(this); + } +} + +class $ModeCodec with _i1.Codec { + const $ModeCodec(); + + @override + Mode decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return Mode.disabled; + case 1: + return Mode.enabled; + default: + throw Exception('Mode: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + Mode value, + _i1.Output output, + ) { + _i1.U8Codec.codec.encodeTo( + value.codecIndex, + output, + ); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_support/traits/tokens/misc/id_amount.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_support/traits/tokens/misc/id_amount.dart new file mode 100644 index 000000000..f7d39471b --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_support/traits/tokens/misc/id_amount.dart @@ -0,0 +1,81 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +class IdAmount { + const IdAmount({ + required this.id, + required this.amount, + }); + + factory IdAmount.decode(_i1.Input input) { + return codec.decode(input); + } + + /// Id + final dynamic id; + + /// Balance + final BigInt amount; + + static const $IdAmountCodec codec = $IdAmountCodec(); + + _i2.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'id': null, + 'amount': amount, + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is IdAmount && other.id == id && other.amount == amount; + + @override + int get hashCode => Object.hash( + id, + amount, + ); +} + +class $IdAmountCodec with _i1.Codec { + const $IdAmountCodec(); + + @override + void encodeTo( + IdAmount obj, + _i1.Output output, + ) { + _i1.NullCodec.codec.encodeTo( + obj.id, + output, + ); + _i1.U128Codec.codec.encodeTo( + obj.amount, + output, + ); + } + + @override + IdAmount decode(_i1.Input input) { + return IdAmount( + id: _i1.NullCodec.codec.decode(input), + amount: _i1.U128Codec.codec.decode(input), + ); + } + + @override + int sizeHint(IdAmount obj) { + int size = 0; + size = size + _i1.NullCodec.codec.sizeHint(obj.id); + size = size + _i1.U128Codec.codec.sizeHint(obj.amount); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/call.dart index ff70b7cbc..9abe77b80 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/call.dart @@ -195,7 +195,9 @@ class $CallCodec with _i1.Codec { } } -/// See [`Pallet::remark`]. +/// Make some on-chain remark. +/// +/// Can be executed by every `origin`. class Remark extends Call { const Remark({required this.remark}); @@ -244,7 +246,7 @@ class Remark extends Call { int get hashCode => remark.hashCode; } -/// See [`Pallet::set_heap_pages`]. +/// Set the number of pages in the WebAssembly environment's heap. class SetHeapPages extends Call { const SetHeapPages({required this.pages}); @@ -289,7 +291,7 @@ class SetHeapPages extends Call { int get hashCode => pages.hashCode; } -/// See [`Pallet::set_code`]. +/// Set the new runtime code. class SetCode extends Call { const SetCode({required this.code}); @@ -338,7 +340,10 @@ class SetCode extends Call { int get hashCode => code.hashCode; } -/// See [`Pallet::set_code_without_checks`]. +/// Set the new runtime code without doing any checks of the given `code`. +/// +/// Note that runtime upgrades will not run if this is called with a not-increasing spec +/// version! class SetCodeWithoutChecks extends Call { const SetCodeWithoutChecks({required this.code}); @@ -387,7 +392,7 @@ class SetCodeWithoutChecks extends Call { int get hashCode => code.hashCode; } -/// See [`Pallet::set_storage`]. +/// Set some items of storage. class SetStorage extends Call { const SetStorage({required this.items}); @@ -454,7 +459,7 @@ class SetStorage extends Call { int get hashCode => items.hashCode; } -/// See [`Pallet::kill_storage`]. +/// Kill some items from storage. class KillStorage extends Call { const KillStorage({required this.keys}); @@ -503,7 +508,10 @@ class KillStorage extends Call { int get hashCode => keys.hashCode; } -/// See [`Pallet::kill_prefix`]. +/// Kill all storage items with a key that starts with the given prefix. +/// +/// **NOTE:** We rely on the Root origin to provide us the number of subkeys under +/// the prefix we are removing to accurately calculate the weight of this function. class KillPrefix extends Call { const KillPrefix({ required this.prefix, @@ -573,7 +581,7 @@ class KillPrefix extends Call { ); } -/// See [`Pallet::remark_with_event`]. +/// Make some on-chain remark and emit event. class RemarkWithEvent extends Call { const RemarkWithEvent({required this.remark}); @@ -622,7 +630,10 @@ class RemarkWithEvent extends Call { int get hashCode => remark.hashCode; } -/// See [`Pallet::authorize_upgrade`]. +/// Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied +/// later. +/// +/// This call requires Root origin. class AuthorizeUpgrade extends Call { const AuthorizeUpgrade({required this.codeHash}); @@ -671,7 +682,14 @@ class AuthorizeUpgrade extends Call { int get hashCode => codeHash.hashCode; } -/// See [`Pallet::authorize_upgrade_without_checks`]. +/// Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied +/// later. +/// +/// WARNING: This authorizes an upgrade that will take place without any safety checks, for +/// example that the spec name remains the same and that the version number increases. Not +/// recommended for normal use. Use `authorize_upgrade` instead. +/// +/// This call requires Root origin. class AuthorizeUpgradeWithoutChecks extends Call { const AuthorizeUpgradeWithoutChecks({required this.codeHash}); @@ -720,7 +738,15 @@ class AuthorizeUpgradeWithoutChecks extends Call { int get hashCode => codeHash.hashCode; } -/// See [`Pallet::apply_authorized_upgrade`]. +/// Provide the preimage (runtime binary) `code` for an upgrade that has been authorized. +/// +/// If the authorization required a version check, this call will ensure the spec name +/// remains unchanged and that the spec version has increased. +/// +/// Depending on the runtime's `OnSetCode` configuration, this function may directly apply +/// the new `code` in the same block or attempt to schedule the upgrade. +/// +/// All origins are allowed. class ApplyAuthorizedUpgrade extends Call { const ApplyAuthorizedUpgrade({required this.code}); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/error.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/error.dart index 4cd910bbc..8c04694e5 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/error.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/error.dart @@ -27,11 +27,14 @@ enum Error { /// The origin filter prevent the call to be dispatched. callFiltered('CallFiltered', 5), + /// A multi-block migration is ongoing and prevents the current code from being replaced. + multiBlockMigrationsOngoing('MultiBlockMigrationsOngoing', 6), + /// No upgrade authorized. - nothingAuthorized('NothingAuthorized', 6), + nothingAuthorized('NothingAuthorized', 7), /// The submitted code is not authorized. - unauthorized('Unauthorized', 7); + unauthorized('Unauthorized', 8); const Error( this.variantName, @@ -74,8 +77,10 @@ class $ErrorCodec with _i1.Codec { case 5: return Error.callFiltered; case 6: - return Error.nothingAuthorized; + return Error.multiBlockMigrationsOngoing; case 7: + return Error.nothingAuthorized; + case 8: return Error.unauthorized; default: throw Exception('Error: Invalid variant index: "$index"'); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_balances/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_balances/pallet/call.dart index 6338314fe..27c882bbd 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_balances/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_balances/pallet/call.dart @@ -111,6 +111,16 @@ class $Call { delta: delta, ); } + + Burn burn({ + required BigInt value, + required bool keepAlive, + }) { + return Burn( + value: value, + keepAlive: keepAlive, + ); + } } class $CallCodec with _i1.Codec { @@ -136,6 +146,8 @@ class $CallCodec with _i1.Codec { return ForceSetBalance._decode(input); case 9: return ForceAdjustTotalIssuance._decode(input); + case 10: + return Burn._decode(input); default: throw Exception('Call: Invalid variant index: "$index"'); } @@ -171,6 +183,9 @@ class $CallCodec with _i1.Codec { case ForceAdjustTotalIssuance: (value as ForceAdjustTotalIssuance).encodeTo(output); break; + case Burn: + (value as Burn).encodeTo(output); + break; default: throw Exception('Call: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -195,13 +210,21 @@ class $CallCodec with _i1.Codec { return (value as ForceSetBalance)._sizeHint(); case ForceAdjustTotalIssuance: return (value as ForceAdjustTotalIssuance)._sizeHint(); + case Burn: + return (value as Burn)._sizeHint(); default: throw Exception('Call: Unsupported "$value" of type "${value.runtimeType}"'); } } } -/// See [`Pallet::transfer_allow_death`]. +/// Transfer some liquid free balance to another account. +/// +/// `transfer_allow_death` will set the `FreeBalance` of the sender and receiver. +/// If the sender's account is below the existential deposit as a result +/// of the transfer, the account will be reaped. +/// +/// The dispatch origin for this call must be `Signed` by the transactor. class TransferAllowDeath extends Call { const TransferAllowDeath({ required this.dest, @@ -266,7 +289,8 @@ class TransferAllowDeath extends Call { ); } -/// See [`Pallet::force_transfer`]. +/// Exactly as `transfer_allow_death`, except the origin must be root and the source account +/// may be specified. class ForceTransfer extends Call { const ForceTransfer({ required this.source, @@ -343,7 +367,12 @@ class ForceTransfer extends Call { ); } -/// See [`Pallet::transfer_keep_alive`]. +/// Same as the [`transfer_allow_death`] call, but with a check that the transfer will not +/// kill the origin account. +/// +/// 99% of the time you want [`transfer_allow_death`] instead. +/// +/// [`transfer_allow_death`]: struct.Pallet.html#method.transfer class TransferKeepAlive extends Call { const TransferKeepAlive({ required this.dest, @@ -408,7 +437,21 @@ class TransferKeepAlive extends Call { ); } -/// See [`Pallet::transfer_all`]. +/// Transfer the entire transferable balance from the caller account. +/// +/// NOTE: This function only attempts to transfer _transferable_ balances. This means that +/// any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be +/// transferred by this function. To ensure that this function results in a killed account, +/// you might need to prepare the account by removing any reference counters, storage +/// deposits, etc... +/// +/// The dispatch origin of this call must be Signed. +/// +/// - `dest`: The recipient of the transfer. +/// - `keep_alive`: A boolean to determine if the `transfer_all` operation should send all +/// of the funds the account has, causing the sender account to be killed (false), or +/// transfer everything except at least the existential deposit, which will guarantee to +/// keep the sender account alive (true). class TransferAll extends Call { const TransferAll({ required this.dest, @@ -473,7 +516,9 @@ class TransferAll extends Call { ); } -/// See [`Pallet::force_unreserve`]. +/// Unreserve some balance from a user by force. +/// +/// Can only be called by ROOT. class ForceUnreserve extends Call { const ForceUnreserve({ required this.who, @@ -538,7 +583,14 @@ class ForceUnreserve extends Call { ); } -/// See [`Pallet::upgrade_accounts`]. +/// Upgrade a specified account. +/// +/// - `origin`: Must be `Signed`. +/// - `who`: The account to be upgraded. +/// +/// This will waive the transaction fee if at least all but 10% of the accounts needed to +/// be upgraded. (We let some not have to be upgraded just in order to allow for the +/// possibility of churn). class UpgradeAccounts extends Call { const UpgradeAccounts({required this.who}); @@ -587,7 +639,9 @@ class UpgradeAccounts extends Call { int get hashCode => who.hashCode; } -/// See [`Pallet::force_set_balance`]. +/// Set the regular balance of a given account. +/// +/// The dispatch origin for this call is `root`. class ForceSetBalance extends Call { const ForceSetBalance({ required this.who, @@ -652,7 +706,11 @@ class ForceSetBalance extends Call { ); } -/// See [`Pallet::force_adjust_total_issuance`]. +/// Adjust the total issuance in a saturating way. +/// +/// Can only be called by root and always needs a positive `delta`. +/// +/// # Example class ForceAdjustTotalIssuance extends Call { const ForceAdjustTotalIssuance({ required this.direction, @@ -716,3 +774,74 @@ class ForceAdjustTotalIssuance extends Call { delta, ); } + +/// Burn the specified liquid free balance from the origin account. +/// +/// If the origin's account ends up below the existential deposit as a result +/// of the burn and `keep_alive` is false, the account will be reaped. +/// +/// Unlike sending funds to a _burn_ address, which merely makes the funds inaccessible, +/// this `burn` operation will reduce total issuance by the amount _burned_. +class Burn extends Call { + const Burn({ + required this.value, + required this.keepAlive, + }); + + factory Burn._decode(_i1.Input input) { + return Burn( + value: _i1.CompactBigIntCodec.codec.decode(input), + keepAlive: _i1.BoolCodec.codec.decode(input), + ); + } + + /// T::Balance + final BigInt value; + + /// bool + final bool keepAlive; + + @override + Map> toJson() => { + 'burn': { + 'value': value, + 'keepAlive': keepAlive, + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(value); + size = size + _i1.BoolCodec.codec.sizeHint(keepAlive); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 10, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + value, + output, + ); + _i1.BoolCodec.codec.encodeTo( + keepAlive, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Burn && other.value == value && other.keepAlive == keepAlive; + + @override + int get hashCode => Object.hash( + value, + keepAlive, + ); +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_balances/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_balances/pallet/call.dart index 4b4ef12dc..bd4c3a62d 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_balances/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_balances/pallet/call.dart @@ -116,7 +116,7 @@ class $CallCodec with _i1.Codec { } } -/// See [`Pallet::transfer`]. +/// Transfer some balance to another account. class Transfer extends Call { const Transfer({ required this.dest, @@ -199,7 +199,6 @@ class Transfer extends Call { ); } -/// See [`Pallet::set_fee_conversion_factor`]. class SetFeeConversionFactor extends Call { const SetFeeConversionFactor({required this.feeConversionFactor}); @@ -244,7 +243,6 @@ class SetFeeConversionFactor extends Call { int get hashCode => feeConversionFactor.hashCode; } -/// See [`Pallet::transfer_all`]. class TransferAll extends Call { const TransferAll({ required this.dest, diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_bazaar/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_bazaar/pallet/call.dart index 26903c477..bceefd148 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_bazaar/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_bazaar/pallet/call.dart @@ -165,7 +165,6 @@ class $CallCodec with _i1.Codec { } } -/// See [`Pallet::create_business`]. class CreateBusiness extends Call { const CreateBusiness({ required this.cid, @@ -235,7 +234,6 @@ class CreateBusiness extends Call { ); } -/// See [`Pallet::update_business`]. class UpdateBusiness extends Call { const UpdateBusiness({ required this.cid, @@ -305,7 +303,6 @@ class UpdateBusiness extends Call { ); } -/// See [`Pallet::delete_business`]. class DeleteBusiness extends Call { const DeleteBusiness({required this.cid}); @@ -350,7 +347,6 @@ class DeleteBusiness extends Call { int get hashCode => cid.hashCode; } -/// See [`Pallet::create_offering`]. class CreateOffering extends Call { const CreateOffering({ required this.cid, @@ -420,7 +416,6 @@ class CreateOffering extends Call { ); } -/// See [`Pallet::update_offering`]. class UpdateOffering extends Call { const UpdateOffering({ required this.cid, @@ -503,7 +498,6 @@ class UpdateOffering extends Call { ); } -/// See [`Pallet::delete_offering`]. class DeleteOffering extends Call { const DeleteOffering({ required this.cid, diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_ceremonies/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_ceremonies/pallet/call.dart index d85fb9686..fd406bf8b 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_ceremonies/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_ceremonies/pallet/call.dart @@ -263,7 +263,6 @@ class $CallCodec with _i1.Codec { } } -/// See [`Pallet::register_participant`]. class RegisterParticipant extends Call { const RegisterParticipant({ required this.cid, @@ -328,7 +327,6 @@ class RegisterParticipant extends Call { ); } -/// See [`Pallet::upgrade_registration`]. class UpgradeRegistration extends Call { const UpgradeRegistration({ required this.cid, @@ -393,7 +391,6 @@ class UpgradeRegistration extends Call { ); } -/// See [`Pallet::unregister_participant`]. class UnregisterParticipant extends Call { const UnregisterParticipant({ required this.cid, @@ -474,7 +471,6 @@ class UnregisterParticipant extends Call { ); } -/// See [`Pallet::attest_attendees`]. class AttestAttendees extends Call { const AttestAttendees({ required this.cid, @@ -557,7 +553,6 @@ class AttestAttendees extends Call { ); } -/// See [`Pallet::endorse_newcomer`]. class EndorseNewcomer extends Call { const EndorseNewcomer({ required this.cid, @@ -627,7 +622,6 @@ class EndorseNewcomer extends Call { ); } -/// See [`Pallet::claim_rewards`]. class ClaimRewards extends Call { const ClaimRewards({ required this.cid, @@ -692,7 +686,6 @@ class ClaimRewards extends Call { ); } -/// See [`Pallet::set_inactivity_timeout`]. class SetInactivityTimeout extends Call { const SetInactivityTimeout({required this.inactivityTimeout}); @@ -737,7 +730,6 @@ class SetInactivityTimeout extends Call { int get hashCode => inactivityTimeout.hashCode; } -/// See [`Pallet::set_endorsement_tickets_per_bootstrapper`]. class SetEndorsementTicketsPerBootstrapper extends Call { const SetEndorsementTicketsPerBootstrapper({required this.endorsementTicketsPerBootstrapper}); @@ -785,7 +777,6 @@ class SetEndorsementTicketsPerBootstrapper extends Call { int get hashCode => endorsementTicketsPerBootstrapper.hashCode; } -/// See [`Pallet::set_endorsement_tickets_per_reputable`]. class SetEndorsementTicketsPerReputable extends Call { const SetEndorsementTicketsPerReputable({required this.endorsementTicketsPerReputable}); @@ -831,7 +822,6 @@ class SetEndorsementTicketsPerReputable extends Call { int get hashCode => endorsementTicketsPerReputable.hashCode; } -/// See [`Pallet::set_reputation_lifetime`]. class SetReputationLifetime extends Call { const SetReputationLifetime({required this.reputationLifetime}); @@ -876,7 +866,6 @@ class SetReputationLifetime extends Call { int get hashCode => reputationLifetime.hashCode; } -/// See [`Pallet::set_meetup_time_offset`]. class SetMeetupTimeOffset extends Call { const SetMeetupTimeOffset({required this.meetupTimeOffset}); @@ -921,7 +910,6 @@ class SetMeetupTimeOffset extends Call { int get hashCode => meetupTimeOffset.hashCode; } -/// See [`Pallet::set_time_tolerance`]. class SetTimeTolerance extends Call { const SetTimeTolerance({required this.timeTolerance}); @@ -966,7 +954,6 @@ class SetTimeTolerance extends Call { int get hashCode => timeTolerance.hashCode; } -/// See [`Pallet::set_location_tolerance`]. class SetLocationTolerance extends Call { const SetLocationTolerance({required this.locationTolerance}); @@ -1011,7 +998,6 @@ class SetLocationTolerance extends Call { int get hashCode => locationTolerance.hashCode; } -/// See [`Pallet::purge_community_ceremony`]. class PurgeCommunityCeremony extends Call { const PurgeCommunityCeremony({required this.communityCeremony}); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_communities/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_communities/pallet/call.dart index 49afd8f93..465c3e49f 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_communities/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_communities/pallet/call.dart @@ -213,7 +213,9 @@ class $CallCodec with _i1.Codec { } } -/// See [`Pallet::new_community`]. +/// Add a new community. +/// +/// May only be called from `T::TrustableForNonDestructiveAction`. class NewCommunity extends Call { const NewCommunity({ required this.location, @@ -322,7 +324,11 @@ class NewCommunity extends Call { ); } -/// See [`Pallet::add_location`]. +/// Add a new meetup `location` to the community with `cid`. +/// +/// May only be called from `T::TrustableForNonDestructiveAction`. +/// +/// Todo: Replace `T::CommunityMaster` with community governance: #137. class AddLocation extends Call { const AddLocation({ required this.cid, @@ -387,7 +393,11 @@ class AddLocation extends Call { ); } -/// See [`Pallet::remove_location`]. +/// Remove an existing meetup `location` from the community with `cid`. +/// +/// May only be called from `T::CommunityMaster`. +/// +/// Todo: Replace `T::CommunityMaster` with community governance: #137. class RemoveLocation extends Call { const RemoveLocation({ required this.cid, @@ -452,7 +462,9 @@ class RemoveLocation extends Call { ); } -/// See [`Pallet::update_community_metadata`]. +/// Update the metadata of the community with `cid`. +/// +/// May only be called from `T::CommunityMaster`. class UpdateCommunityMetadata extends Call { const UpdateCommunityMetadata({ required this.cid, @@ -517,7 +529,6 @@ class UpdateCommunityMetadata extends Call { ); } -/// See [`Pallet::update_demurrage`]. class UpdateDemurrage extends Call { const UpdateDemurrage({ required this.cid, @@ -582,7 +593,6 @@ class UpdateDemurrage extends Call { ); } -/// See [`Pallet::update_nominal_income`]. class UpdateNominalIncome extends Call { const UpdateNominalIncome({ required this.cid, @@ -647,7 +657,6 @@ class UpdateNominalIncome extends Call { ); } -/// See [`Pallet::set_min_solar_trip_time_s`]. class SetMinSolarTripTimeS extends Call { const SetMinSolarTripTimeS({required this.minSolarTripTimeS}); @@ -692,7 +701,6 @@ class SetMinSolarTripTimeS extends Call { int get hashCode => minSolarTripTimeS.hashCode; } -/// See [`Pallet::set_max_speed_mps`]. class SetMaxSpeedMps extends Call { const SetMaxSpeedMps({required this.maxSpeedMps}); @@ -737,7 +745,6 @@ class SetMaxSpeedMps extends Call { int get hashCode => maxSpeedMps.hashCode; } -/// See [`Pallet::purge_community`]. class PurgeCommunity extends Call { const PurgeCommunity({required this.cid}); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_communities/pallet/error.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_communities/pallet/error.dart index f91a41bb9..c9f2acb7a 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_communities/pallet/error.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_communities/pallet/error.dart @@ -8,7 +8,7 @@ enum Error { /// Location is not a valid geolocation invalidLocation('InvalidLocation', 0), - /// Invalid amount of bootstrappers supplied. Needs to be /[3, 12/] + /// Invalid amount of bootstrappers supplied. Needs to be \[3, 12\] invalidAmountBootstrappers('InvalidAmountBootstrappers', 1), /// minimum distance violation to other location diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_democracy/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_democracy/pallet/call.dart index f0de31a40..ef85d5179 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_democracy/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_democracy/pallet/call.dart @@ -111,7 +111,6 @@ class $CallCodec with _i1.Codec { } } -/// See [`Pallet::submit_proposal`]. class SubmitProposal extends Call { const SubmitProposal({required this.proposalAction}); @@ -119,7 +118,7 @@ class SubmitProposal extends Call { return SubmitProposal(proposalAction: _i3.ProposalAction.codec.decode(input)); } - /// ProposalAction + /// ProposalAction> final _i3.ProposalAction proposalAction; @override @@ -156,7 +155,6 @@ class SubmitProposal extends Call { int get hashCode => proposalAction.hashCode; } -/// See [`Pallet::vote`]. class Vote extends Call { const Vote({ required this.proposalId, @@ -255,7 +253,6 @@ class Vote extends Call { ); } -/// See [`Pallet::update_proposal_state`]. class UpdateProposalState extends Call { const UpdateProposalState({required this.proposalId}); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_democracy/pallet/event.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_democracy/pallet/event.dart index 56ac1862d..de0657ed7 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_democracy/pallet/event.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_democracy/pallet/event.dart @@ -2,7 +2,9 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i8; +import '../../encointer_primitives/communities/community_identifier.dart' as _i7; import '../../encointer_primitives/democracy/proposal_action.dart' as _i3; import '../../encointer_primitives/democracy/proposal_state.dart' as _i5; import '../../encointer_primitives/democracy/vote.dart' as _i4; @@ -91,6 +93,16 @@ class $Event { reason: reason, ); } + + PetitionApproved petitionApproved({ + _i7.CommunityIdentifier? cid, + required List text, + }) { + return PetitionApproved( + cid: cid, + text: text, + ); + } } class $EventCodec with _i1.Codec { @@ -112,6 +124,8 @@ class $EventCodec with _i1.Codec { return ProposalStateUpdated._decode(input); case 5: return EnactmentFailed._decode(input); + case 6: + return PetitionApproved._decode(input); default: throw Exception('Event: Invalid variant index: "$index"'); } @@ -141,6 +155,9 @@ class $EventCodec with _i1.Codec { case EnactmentFailed: (value as EnactmentFailed).encodeTo(output); break; + case PetitionApproved: + (value as PetitionApproved).encodeTo(output); + break; default: throw Exception('Event: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -161,6 +178,8 @@ class $EventCodec with _i1.Codec { return (value as ProposalStateUpdated)._sizeHint(); case EnactmentFailed: return (value as EnactmentFailed)._sizeHint(); + case PetitionApproved: + return (value as PetitionApproved)._sizeHint(); default: throw Exception('Event: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -228,7 +247,7 @@ class ProposalSubmitted extends Event { /// ProposalIdType final BigInt proposalId; - /// ProposalAction + /// ProposalAction> final _i3.ProposalAction proposalAction; @override @@ -543,3 +562,72 @@ class EnactmentFailed extends Event { reason, ); } + +class PetitionApproved extends Event { + const PetitionApproved({ + this.cid, + required this.text, + }); + + factory PetitionApproved._decode(_i1.Input input) { + return PetitionApproved( + cid: const _i1.OptionCodec<_i7.CommunityIdentifier>(_i7.CommunityIdentifier.codec).decode(input), + text: _i1.U8SequenceCodec.codec.decode(input), + ); + } + + /// Option + final _i7.CommunityIdentifier? cid; + + /// PalletString + final List text; + + @override + Map> toJson() => { + 'PetitionApproved': { + 'cid': cid?.toJson(), + 'text': text, + } + }; + + int _sizeHint() { + int size = 1; + size = size + const _i1.OptionCodec<_i7.CommunityIdentifier>(_i7.CommunityIdentifier.codec).sizeHint(cid); + size = size + _i1.U8SequenceCodec.codec.sizeHint(text); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 6, + output, + ); + const _i1.OptionCodec<_i7.CommunityIdentifier>(_i7.CommunityIdentifier.codec).encodeTo( + cid, + output, + ); + _i1.U8SequenceCodec.codec.encodeTo( + text, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is PetitionApproved && + other.cid == cid && + _i8.listsEqual( + other.text, + text, + ); + + @override + int get hashCode => Object.hash( + cid, + text, + ); +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_faucet/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_faucet/pallet/call.dart index 26bd84903..4bf31c13f 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_faucet/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_faucet/pallet/call.dart @@ -147,7 +147,6 @@ class $CallCodec with _i1.Codec { } } -/// See [`Pallet::create_faucet`]. class CreateFaucet extends Call { const CreateFaucet({ required this.name, @@ -250,7 +249,6 @@ class CreateFaucet extends Call { ); } -/// See [`Pallet::drip`]. class Drip extends Call { const Drip({ required this.faucetAccount, @@ -333,7 +331,6 @@ class Drip extends Call { ); } -/// See [`Pallet::dissolve_faucet`]. class DissolveFaucet extends Call { const DissolveFaucet({ required this.faucetAccount, @@ -406,7 +403,6 @@ class DissolveFaucet extends Call { ); } -/// See [`Pallet::close_faucet`]. class CloseFaucet extends Call { const CloseFaucet({required this.faucetAccount}); @@ -455,7 +451,6 @@ class CloseFaucet extends Call { int get hashCode => faucetAccount.hashCode; } -/// See [`Pallet::set_reserve_amount`]. class SetReserveAmount extends Call { const SetReserveAmount({required this.reserveAmount}); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_reputation_commitments/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_reputation_commitments/pallet/call.dart index bc7b2d6d7..1efb9774c 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_reputation_commitments/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_reputation_commitments/pallet/call.dart @@ -100,7 +100,6 @@ class $CallCodec with _i1.Codec { } } -/// See [`Pallet::register_purpose`]. class RegisterPurpose extends Call { const RegisterPurpose({required this.descriptor}); @@ -149,7 +148,6 @@ class RegisterPurpose extends Call { int get hashCode => descriptor.hashCode; } -/// See [`Pallet::commit_reputation`]. class CommitReputation extends Call { const CommitReputation({ required this.cid, diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_scheduler/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_scheduler/pallet/call.dart index 48f40dcdd..112c09f2f 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_scheduler/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_scheduler/pallet/call.dart @@ -116,7 +116,9 @@ class $CallCodec with _i1.Codec { } } -/// See [`Pallet::next_phase`]. +/// Manually transition to next phase without affecting the ceremony rhythm +/// +/// May only be called from `T::CeremonyMaster`. class NextPhase extends Call { const NextPhase(); @@ -137,7 +139,9 @@ class NextPhase extends Call { int get hashCode => runtimeType.hashCode; } -/// See [`Pallet::push_by_one_day`]. +/// Push next phase change by one entire day +/// +/// May only be called from `T::CeremonyMaster`. class PushByOneDay extends Call { const PushByOneDay(); @@ -158,7 +162,6 @@ class PushByOneDay extends Call { int get hashCode => runtimeType.hashCode; } -/// See [`Pallet::set_phase_duration`]. class SetPhaseDuration extends Call { const SetPhaseDuration({ required this.ceremonyPhase, @@ -223,7 +226,6 @@ class SetPhaseDuration extends Call { ); } -/// See [`Pallet::set_next_phase_timestamp`]. class SetNextPhaseTimestamp extends Call { const SetNextPhaseTimestamp({required this.timestamp}); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_treasuries/pallet/event.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_treasuries/pallet/event.dart new file mode 100644 index 000000000..a0363732f --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_treasuries/pallet/event.dart @@ -0,0 +1,173 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i4; + +import '../../sp_core/crypto/account_id32.dart' as _i3; + +/// The `Event` enum of this pallet +abstract class Event { + const Event(); + + factory Event.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $EventCodec codec = $EventCodec(); + + static const $Event values = $Event(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map> toJson(); +} + +class $Event { + const $Event(); + + SpentNative spentNative({ + required _i3.AccountId32 treasury, + required _i3.AccountId32 beneficiary, + required BigInt amount, + }) { + return SpentNative( + treasury: treasury, + beneficiary: beneficiary, + amount: amount, + ); + } +} + +class $EventCodec with _i1.Codec { + const $EventCodec(); + + @override + Event decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return SpentNative._decode(input); + default: + throw Exception('Event: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + Event value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case SpentNative: + (value as SpentNative).encodeTo(output); + break; + default: + throw Exception('Event: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(Event value) { + switch (value.runtimeType) { + case SpentNative: + return (value as SpentNative)._sizeHint(); + default: + throw Exception('Event: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +/// treasury spent native tokens from community `cid` to `beneficiary` amounting `amount` +class SpentNative extends Event { + const SpentNative({ + required this.treasury, + required this.beneficiary, + required this.amount, + }); + + factory SpentNative._decode(_i1.Input input) { + return SpentNative( + treasury: const _i1.U8ArrayCodec(32).decode(input), + beneficiary: const _i1.U8ArrayCodec(32).decode(input), + amount: _i1.U128Codec.codec.decode(input), + ); + } + + /// T::AccountId + final _i3.AccountId32 treasury; + + /// T::AccountId + final _i3.AccountId32 beneficiary; + + /// BalanceOf + final BigInt amount; + + @override + Map> toJson() => { + 'SpentNative': { + 'treasury': treasury.toList(), + 'beneficiary': beneficiary.toList(), + 'amount': amount, + } + }; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AccountId32Codec().sizeHint(treasury); + size = size + const _i3.AccountId32Codec().sizeHint(beneficiary); + size = size + _i1.U128Codec.codec.sizeHint(amount); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 0, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + treasury, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + beneficiary, + output, + ); + _i1.U128Codec.codec.encodeTo( + amount, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is SpentNative && + _i4.listsEqual( + other.treasury, + treasury, + ) && + _i4.listsEqual( + other.beneficiary, + beneficiary, + ) && + other.amount == amount; + + @override + int get hashCode => Object.hash( + treasury, + beneficiary, + amount, + ); +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_grandpa/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_grandpa/pallet/call.dart index 5b0c1f2b1..c7d8f2a28 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_grandpa/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_grandpa/pallet/call.dart @@ -118,7 +118,10 @@ class $CallCodec with _i1.Codec { } } -/// See [`Pallet::report_equivocation`]. +/// Report voter equivocation/misbehavior. This method will verify the +/// equivocation proof and validate the given key ownership proof +/// against the extracted offender. If both are valid, the offence +/// will be reported. class ReportEquivocation extends Call { const ReportEquivocation({ required this.equivocationProof, @@ -185,7 +188,15 @@ class ReportEquivocation extends Call { ); } -/// See [`Pallet::report_equivocation_unsigned`]. +/// Report voter equivocation/misbehavior. This method will verify the +/// equivocation proof and validate the given key ownership proof +/// against the extracted offender. If both are valid, the offence +/// will be reported. +/// +/// This extrinsic must be called unsigned and it is expected that only +/// block authors will call it (validated in `ValidateUnsigned`), as such +/// if the block author is defined it will be defined as the equivocation +/// reporter. class ReportEquivocationUnsigned extends Call { const ReportEquivocationUnsigned({ required this.equivocationProof, @@ -252,7 +263,18 @@ class ReportEquivocationUnsigned extends Call { ); } -/// See [`Pallet::note_stalled`]. +/// Note that the current authority set of the GRANDPA finality gadget has stalled. +/// +/// This will trigger a forced authority set change at the beginning of the next session, to +/// be enacted `delay` blocks after that. The `delay` should be high enough to safely assume +/// that the block signalling the forced change will not be re-orged e.g. 1000 blocks. +/// The block production rate (which may be slowed down because of finality lagging) should +/// be taken into account when choosing the `delay`. The GRANDPA voters based on the new +/// authority will start voting on top of `best_finalized_block_number` for new finalized +/// blocks. `best_finalized_block_number` should be the highest of the latest finalized +/// block of all validators of the new authority set. +/// +/// Only callable by root. class NoteStalled extends Call { const NoteStalled({ required this.delay, diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_proxy/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_proxy/pallet/call.dart index 53338656c..2eb46ce7a 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_proxy/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_proxy/pallet/call.dart @@ -252,7 +252,15 @@ class $CallCodec with _i1.Codec { } } -/// See [`Pallet::proxy`]. +/// Dispatch the given `call` from an account that the sender is authorised for through +/// `add_proxy`. +/// +/// The dispatch origin for this call must be _Signed_. +/// +/// Parameters: +/// - `real`: The account that the proxy will make a call on behalf of. +/// - `force_proxy_type`: Specify the exact proxy type to be used and checked for this call. +/// - `call`: The call to be made by the `real` account. class Proxy extends Call { const Proxy({ required this.real, @@ -329,7 +337,15 @@ class Proxy extends Call { ); } -/// See [`Pallet::add_proxy`]. +/// Register a proxy account for the sender that is able to make calls on its behalf. +/// +/// The dispatch origin for this call must be _Signed_. +/// +/// Parameters: +/// - `proxy`: The account that the `caller` would like to make a proxy. +/// - `proxy_type`: The permissions allowed for this proxy account. +/// - `delay`: The announcement period required of the initial proxy. Will generally be +/// zero. class AddProxy extends Call { const AddProxy({ required this.delegate, @@ -406,7 +422,13 @@ class AddProxy extends Call { ); } -/// See [`Pallet::remove_proxy`]. +/// Unregister a proxy account for the sender. +/// +/// The dispatch origin for this call must be _Signed_. +/// +/// Parameters: +/// - `proxy`: The account that the `caller` would like to remove as a proxy. +/// - `proxy_type`: The permissions currently enabled for the removed proxy account. class RemoveProxy extends Call { const RemoveProxy({ required this.delegate, @@ -483,7 +505,12 @@ class RemoveProxy extends Call { ); } -/// See [`Pallet::remove_proxies`]. +/// Unregister all proxy accounts for the sender. +/// +/// The dispatch origin for this call must be _Signed_. +/// +/// WARNING: This may be called on accounts created by `pure`, however if done, then +/// the unreserved fees will be inaccessible. **All access to this account will be lost.** class RemoveProxies extends Call { const RemoveProxies(); @@ -504,7 +531,24 @@ class RemoveProxies extends Call { int get hashCode => runtimeType.hashCode; } -/// See [`Pallet::create_pure`]. +/// Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and +/// initialize it with a proxy of `proxy_type` for `origin` sender. +/// +/// Requires a `Signed` origin. +/// +/// - `proxy_type`: The type of the proxy that the sender will be registered as over the +/// new account. This will almost always be the most permissive `ProxyType` possible to +/// allow for maximum flexibility. +/// - `index`: A disambiguation index, in case this is called multiple times in the same +/// transaction (e.g. with `utility::batch`). Unless you're using `batch` you probably just +/// want to use `0`. +/// - `delay`: The announcement period required of the initial proxy. Will generally be +/// zero. +/// +/// Fails with `Duplicate` if this has already been called in this transaction, from the +/// same sender, with the same parameters. +/// +/// Fails if there are insufficient funds to pay for deposit. class CreatePure extends Call { const CreatePure({ required this.proxyType, @@ -581,7 +625,22 @@ class CreatePure extends Call { ); } -/// See [`Pallet::kill_pure`]. +/// Removes a previously spawned pure proxy. +/// +/// WARNING: **All access to this account will be lost.** Any funds held in it will be +/// inaccessible. +/// +/// Requires a `Signed` origin, and the sender account must have been created by a call to +/// `pure` with corresponding parameters. +/// +/// - `spawner`: The account that originally called `pure` to create this account. +/// - `index`: The disambiguation index originally passed to `pure`. Probably `0`. +/// - `proxy_type`: The proxy type originally passed to `pure`. +/// - `height`: The height of the chain when the call to `pure` was processed. +/// - `ext_index`: The extrinsic index in which the call to `pure` was processed. +/// +/// Fails with `NoPermission` in case the caller is not a previously created pure +/// account whose `pure` call has corresponding parameters. class KillPure extends Call { const KillPure({ required this.spawner, @@ -687,7 +746,21 @@ class KillPure extends Call { ); } -/// See [`Pallet::announce`]. +/// Publish the hash of a proxy-call that will be made in the future. +/// +/// This must be called some number of blocks before the corresponding `proxy` is attempted +/// if the delay associated with the proxy relationship is greater than zero. +/// +/// No more than `MaxPending` announcements may be made at any one time. +/// +/// This will take a deposit of `AnnouncementDepositFactor` as well as +/// `AnnouncementDepositBase` if there are no other pending announcements. +/// +/// The dispatch origin for this call must be _Signed_ and a proxy of `real`. +/// +/// Parameters: +/// - `real`: The account that the proxy will make a call on behalf of. +/// - `call_hash`: The hash of the call to be made by the `real` account. class Announce extends Call { const Announce({ required this.real, @@ -757,7 +830,16 @@ class Announce extends Call { ); } -/// See [`Pallet::remove_announcement`]. +/// Remove a given announcement. +/// +/// May be called by a proxy account to remove a call they previously announced and return +/// the deposit. +/// +/// The dispatch origin for this call must be _Signed_. +/// +/// Parameters: +/// - `real`: The account that the proxy will make a call on behalf of. +/// - `call_hash`: The hash of the call to be made by the `real` account. class RemoveAnnouncement extends Call { const RemoveAnnouncement({ required this.real, @@ -827,7 +909,16 @@ class RemoveAnnouncement extends Call { ); } -/// See [`Pallet::reject_announcement`]. +/// Remove the given announcement of a delegate. +/// +/// May be called by a target (proxied) account to remove a call that one of their delegates +/// (`delegate`) has announced they want to execute. The deposit is returned. +/// +/// The dispatch origin for this call must be _Signed_. +/// +/// Parameters: +/// - `delegate`: The account that previously announced the call. +/// - `call_hash`: The hash of the call to be made. class RejectAnnouncement extends Call { const RejectAnnouncement({ required this.delegate, @@ -897,7 +988,17 @@ class RejectAnnouncement extends Call { ); } -/// See [`Pallet::proxy_announced`]. +/// Dispatch the given `call` from an account that the sender is authorized for through +/// `add_proxy`. +/// +/// Removes any corresponding announcement(s). +/// +/// The dispatch origin for this call must be _Signed_. +/// +/// Parameters: +/// - `real`: The account that the proxy will make a call on behalf of. +/// - `force_proxy_type`: Specify the exact proxy type to be used and checked for this call. +/// - `call`: The call to be made by the `real` account. class ProxyAnnounced extends Call { const ProxyAnnounced({ required this.delegate, diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_scheduler/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_scheduler/pallet/call.dart index dbbdaafe0..263d5cf65 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_scheduler/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_scheduler/pallet/call.dart @@ -244,7 +244,7 @@ class $CallCodec with _i1.Codec { } } -/// See [`Pallet::schedule`]. +/// Anonymously schedule a task. class Schedule extends Call { const Schedule({ required this.when, @@ -350,7 +350,7 @@ class Schedule extends Call { ); } -/// See [`Pallet::cancel`]. +/// Cancel an anonymously scheduled task. class Cancel extends Call { const Cancel({ required this.when, @@ -415,7 +415,7 @@ class Cancel extends Call { ); } -/// See [`Pallet::schedule_named`]. +/// Schedule a named task. class ScheduleNamed extends Call { const ScheduleNamed({ required this.id, @@ -537,7 +537,7 @@ class ScheduleNamed extends Call { ); } -/// See [`Pallet::cancel_named`]. +/// Cancel a named scheduled task. class CancelNamed extends Call { const CancelNamed({required this.id}); @@ -586,7 +586,7 @@ class CancelNamed extends Call { int get hashCode => id.hashCode; } -/// See [`Pallet::schedule_after`]. +/// Anonymously schedule a task after a delay. class ScheduleAfter extends Call { const ScheduleAfter({ required this.after, @@ -692,7 +692,7 @@ class ScheduleAfter extends Call { ); } -/// See [`Pallet::schedule_named_after`]. +/// Schedule a named task after a delay. class ScheduleNamedAfter extends Call { const ScheduleNamedAfter({ required this.id, @@ -814,7 +814,18 @@ class ScheduleNamedAfter extends Call { ); } -/// See [`Pallet::set_retry`]. +/// Set a retry configuration for a task so that, in case its scheduled run fails, it will +/// be retried after `period` blocks, for a total amount of `retries` retries or until it +/// succeeds. +/// +/// Tasks which need to be scheduled for a retry are still subject to weight metering and +/// agenda space, same as a regular task. If a periodic task fails, it will be scheduled +/// normally while the task is retrying. +/// +/// Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic +/// clones of the original task. Their retry configuration will be derived from the +/// original task's configuration, but will have a lower value for `remaining` than the +/// original `total_retries`. class SetRetry extends Call { const SetRetry({ required this.task, @@ -904,7 +915,18 @@ class SetRetry extends Call { ); } -/// See [`Pallet::set_retry_named`]. +/// Set a retry configuration for a named task so that, in case its scheduled run fails, it +/// will be retried after `period` blocks, for a total amount of `retries` retries or until +/// it succeeds. +/// +/// Tasks which need to be scheduled for a retry are still subject to weight metering and +/// agenda space, same as a regular task. If a periodic task fails, it will be scheduled +/// normally while the task is retrying. +/// +/// Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic +/// clones of the original task. Their retry configuration will be derived from the +/// original task's configuration, but will have a lower value for `remaining` than the +/// original `total_retries`. class SetRetryNamed extends Call { const SetRetryNamed({ required this.id, @@ -987,7 +1009,7 @@ class SetRetryNamed extends Call { ); } -/// See [`Pallet::cancel_retry`]. +/// Removes the retry configuration of a task. class CancelRetry extends Call { const CancelRetry({required this.task}); @@ -1048,7 +1070,7 @@ class CancelRetry extends Call { int get hashCode => task.hashCode; } -/// See [`Pallet::cancel_retry_named`]. +/// Cancel the retry configuration of a named task. class CancelRetryNamed extends Call { const CancelRetryNamed({required this.id}); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_sudo/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_sudo/pallet/call.dart index 7f939073b..d39b869aa 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_sudo/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_sudo/pallet/call.dart @@ -135,7 +135,7 @@ class $CallCodec with _i1.Codec { } } -/// See [`Pallet::sudo`]. +/// Authenticates the sudo key and dispatches a function call with `Root` origin. class Sudo extends Call { const Sudo({required this.call}); @@ -180,7 +180,11 @@ class Sudo extends Call { int get hashCode => call.hashCode; } -/// See [`Pallet::sudo_unchecked_weight`]. +/// Authenticates the sudo key and dispatches a function call with `Root` origin. +/// This function does not check the weight of the call, and instead allows the +/// Sudo user to specify the weight of the call. +/// +/// The dispatch origin for this call must be _Signed_. class SudoUncheckedWeight extends Call { const SudoUncheckedWeight({ required this.call, @@ -245,7 +249,8 @@ class SudoUncheckedWeight extends Call { ); } -/// See [`Pallet::set_key`]. +/// Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo +/// key. class SetKey extends Call { const SetKey({required this.new_}); @@ -290,7 +295,10 @@ class SetKey extends Call { int get hashCode => new_.hashCode; } -/// See [`Pallet::sudo_as`]. +/// Authenticates the sudo key and dispatches a function call with `Signed` origin from +/// a given account. +/// +/// The dispatch origin for this call must be _Signed_. class SudoAs extends Call { const SudoAs({ required this.who, @@ -355,7 +363,9 @@ class SudoAs extends Call { ); } -/// See [`Pallet::remove_key`]. +/// Permanently removes the sudo key. +/// +/// **This cannot be un-done.** class RemoveKey extends Call { const RemoveKey(); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_timestamp/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_timestamp/pallet/call.dart index 09094e7ec..ce51e248b 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_timestamp/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_timestamp/pallet/call.dart @@ -75,7 +75,25 @@ class $CallCodec with _i1.Codec { } } -/// See [`Pallet::set`]. +/// Set the current time. +/// +/// This call should be invoked exactly once per block. It will panic at the finalization +/// phase, if this call hasn't been invoked by that time. +/// +/// The timestamp should be greater than the previous one by the amount specified by +/// [`Config::MinimumPeriod`]. +/// +/// The dispatch origin for this call must be _None_. +/// +/// This dispatch class is _Mandatory_ to ensure it gets executed in the block. Be aware +/// that changing the complexity of this call could result exhausting the resources in a +/// block to execute any other calls. +/// +/// ## Complexity +/// - `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`) +/// - 1 storage read and 1 storage mutation (codec `O(1)` because of `DidUpdate::take` in +/// `on_finalize`) +/// - 1 event handler `on_timestamp_set`. Must be `O(1)`. class Set extends Call { const Set({required this.now}); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/call.dart index df2cf0064..5568bf3f5 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/call.dart @@ -35,24 +35,6 @@ abstract class Call { class $Call { const $Call(); - ProposeSpend proposeSpend({ - required BigInt value, - required _i3.MultiAddress beneficiary, - }) { - return ProposeSpend( - value: value, - beneficiary: beneficiary, - ); - } - - RejectProposal rejectProposal({required BigInt proposalId}) { - return RejectProposal(proposalId: proposalId); - } - - ApproveProposal approveProposal({required BigInt proposalId}) { - return ApproveProposal(proposalId: proposalId); - } - SpendLocal spendLocal({ required BigInt amount, required _i3.MultiAddress beneficiary, @@ -101,12 +83,6 @@ class $CallCodec with _i1.Codec { Call decode(_i1.Input input) { final index = _i1.U8Codec.codec.decode(input); switch (index) { - case 0: - return ProposeSpend._decode(input); - case 1: - return RejectProposal._decode(input); - case 2: - return ApproveProposal._decode(input); case 3: return SpendLocal._decode(input); case 4: @@ -130,15 +106,6 @@ class $CallCodec with _i1.Codec { _i1.Output output, ) { switch (value.runtimeType) { - case ProposeSpend: - (value as ProposeSpend).encodeTo(output); - break; - case RejectProposal: - (value as RejectProposal).encodeTo(output); - break; - case ApproveProposal: - (value as ApproveProposal).encodeTo(output); - break; case SpendLocal: (value as SpendLocal).encodeTo(output); break; @@ -165,12 +132,6 @@ class $CallCodec with _i1.Codec { @override int sizeHint(Call value) { switch (value.runtimeType) { - case ProposeSpend: - return (value as ProposeSpend)._sizeHint(); - case RejectProposal: - return (value as RejectProposal)._sizeHint(); - case ApproveProposal: - return (value as ApproveProposal)._sizeHint(); case SpendLocal: return (value as SpendLocal)._sizeHint(); case RemoveApproval: @@ -189,162 +150,23 @@ class $CallCodec with _i1.Codec { } } -/// See [`Pallet::propose_spend`]. -class ProposeSpend extends Call { - const ProposeSpend({ - required this.value, - required this.beneficiary, - }); - - factory ProposeSpend._decode(_i1.Input input) { - return ProposeSpend( - value: _i1.CompactBigIntCodec.codec.decode(input), - beneficiary: _i3.MultiAddress.codec.decode(input), - ); - } - - /// BalanceOf - final BigInt value; - - /// AccountIdLookupOf - final _i3.MultiAddress beneficiary; - - @override - Map> toJson() => { - 'propose_spend': { - 'value': value, - 'beneficiary': beneficiary.toJson(), - } - }; - - int _sizeHint() { - int size = 1; - size = size + _i1.CompactBigIntCodec.codec.sizeHint(value); - size = size + _i3.MultiAddress.codec.sizeHint(beneficiary); - return size; - } - - void encodeTo(_i1.Output output) { - _i1.U8Codec.codec.encodeTo( - 0, - output, - ); - _i1.CompactBigIntCodec.codec.encodeTo( - value, - output, - ); - _i3.MultiAddress.codec.encodeTo( - beneficiary, - output, - ); - } - - @override - bool operator ==(Object other) => - identical( - this, - other, - ) || - other is ProposeSpend && other.value == value && other.beneficiary == beneficiary; - - @override - int get hashCode => Object.hash( - value, - beneficiary, - ); -} - -/// See [`Pallet::reject_proposal`]. -class RejectProposal extends Call { - const RejectProposal({required this.proposalId}); - - factory RejectProposal._decode(_i1.Input input) { - return RejectProposal(proposalId: _i1.CompactBigIntCodec.codec.decode(input)); - } - - /// ProposalIndex - final BigInt proposalId; - - @override - Map> toJson() => { - 'reject_proposal': {'proposalId': proposalId} - }; - - int _sizeHint() { - int size = 1; - size = size + _i1.CompactBigIntCodec.codec.sizeHint(proposalId); - return size; - } - - void encodeTo(_i1.Output output) { - _i1.U8Codec.codec.encodeTo( - 1, - output, - ); - _i1.CompactBigIntCodec.codec.encodeTo( - proposalId, - output, - ); - } - - @override - bool operator ==(Object other) => - identical( - this, - other, - ) || - other is RejectProposal && other.proposalId == proposalId; - - @override - int get hashCode => proposalId.hashCode; -} - -/// See [`Pallet::approve_proposal`]. -class ApproveProposal extends Call { - const ApproveProposal({required this.proposalId}); - - factory ApproveProposal._decode(_i1.Input input) { - return ApproveProposal(proposalId: _i1.CompactBigIntCodec.codec.decode(input)); - } - - /// ProposalIndex - final BigInt proposalId; - - @override - Map> toJson() => { - 'approve_proposal': {'proposalId': proposalId} - }; - - int _sizeHint() { - int size = 1; - size = size + _i1.CompactBigIntCodec.codec.sizeHint(proposalId); - return size; - } - - void encodeTo(_i1.Output output) { - _i1.U8Codec.codec.encodeTo( - 2, - output, - ); - _i1.CompactBigIntCodec.codec.encodeTo( - proposalId, - output, - ); - } - - @override - bool operator ==(Object other) => - identical( - this, - other, - ) || - other is ApproveProposal && other.proposalId == proposalId; - - @override - int get hashCode => proposalId.hashCode; -} - -/// See [`Pallet::spend_local`]. +/// Propose and approve a spend of treasury funds. +/// +/// ## Dispatch Origin +/// +/// Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`. +/// +/// ### Details +/// NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the +/// beneficiary. +/// +/// ### Parameters +/// - `amount`: The amount to be transferred from the treasury to the `beneficiary`. +/// - `beneficiary`: The destination account for the transfer. +/// +/// ## Events +/// +/// Emits [`Event::SpendApproved`] if successful. class SpendLocal extends Call { const SpendLocal({ required this.amount, @@ -409,7 +231,27 @@ class SpendLocal extends Call { ); } -/// See [`Pallet::remove_approval`]. +/// Force a previously approved proposal to be removed from the approval queue. +/// +/// ## Dispatch Origin +/// +/// Must be [`Config::RejectOrigin`]. +/// +/// ## Details +/// +/// The original deposit will no longer be returned. +/// +/// ### Parameters +/// - `proposal_id`: The index of a proposal +/// +/// ### Complexity +/// - O(A) where `A` is the number of approvals +/// +/// ### Errors +/// - [`Error::ProposalNotApproved`]: The `proposal_id` supplied was not found in the +/// approval queue, i.e., the proposal has not been approved. This could also mean the +/// proposal does not exist altogether, thus there is no way it would have been approved +/// in the first place. class RemoveApproval extends Call { const RemoveApproval({required this.proposalId}); @@ -454,7 +296,32 @@ class RemoveApproval extends Call { int get hashCode => proposalId.hashCode; } -/// See [`Pallet::spend`]. +/// Propose and approve a spend of treasury funds. +/// +/// ## Dispatch Origin +/// +/// Must be [`Config::SpendOrigin`] with the `Success` value being at least +/// `amount` of `asset_kind` in the native asset. The amount of `asset_kind` is converted +/// for assertion using the [`Config::BalanceConverter`]. +/// +/// ## Details +/// +/// Create an approved spend for transferring a specific `amount` of `asset_kind` to a +/// designated beneficiary. The spend must be claimed using the `payout` dispatchable within +/// the [`Config::PayoutPeriod`]. +/// +/// ### Parameters +/// - `asset_kind`: An indicator of the specific asset class to be spent. +/// - `amount`: The amount to be transferred from the treasury to the `beneficiary`. +/// - `beneficiary`: The beneficiary of the spend. +/// - `valid_from`: The block number from which the spend can be claimed. It can refer to +/// the past if the resulting spend has not yet expired according to the +/// [`Config::PayoutPeriod`]. If `None`, the spend can be claimed immediately after +/// approval. +/// +/// ## Events +/// +/// Emits [`Event::AssetSpendApproved`] if successful. class Spend extends Call { const Spend({ required this.assetKind, @@ -550,7 +417,25 @@ class Spend extends Call { ); } -/// See [`Pallet::payout`]. +/// Claim a spend. +/// +/// ## Dispatch Origin +/// +/// Must be signed +/// +/// ## Details +/// +/// Spends must be claimed within some temporal bounds. A spend may be claimed within one +/// [`Config::PayoutPeriod`] from the `valid_from` block. +/// In case of a payout failure, the spend status must be updated with the `check_status` +/// dispatchable before retrying with the current function. +/// +/// ### Parameters +/// - `index`: The spend index. +/// +/// ## Events +/// +/// Emits [`Event::Paid`] if successful. class Payout extends Call { const Payout({required this.index}); @@ -595,7 +480,25 @@ class Payout extends Call { int get hashCode => index.hashCode; } -/// See [`Pallet::check_status`]. +/// Check the status of the spend and remove it from the storage if processed. +/// +/// ## Dispatch Origin +/// +/// Must be signed. +/// +/// ## Details +/// +/// The status check is a prerequisite for retrying a failed payout. +/// If a spend has either succeeded or expired, it is removed from the storage by this +/// function. In such instances, transaction fees are refunded. +/// +/// ### Parameters +/// - `index`: The spend index. +/// +/// ## Events +/// +/// Emits [`Event::PaymentFailed`] if the spend payout has failed. +/// Emits [`Event::SpendProcessed`] if the spend payout has succeed. class CheckStatus extends Call { const CheckStatus({required this.index}); @@ -640,7 +543,22 @@ class CheckStatus extends Call { int get hashCode => index.hashCode; } -/// See [`Pallet::void_spend`]. +/// Void previously approved spend. +/// +/// ## Dispatch Origin +/// +/// Must be [`Config::RejectOrigin`]. +/// +/// ## Details +/// +/// A spend void is only possible if the payout has not been attempted yet. +/// +/// ### Parameters +/// - `index`: The spend index. +/// +/// ## Events +/// +/// Emits [`Event::AssetSpendVoided`] if successful. class VoidSpend extends Call { const VoidSpend({required this.index}); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/error.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/error.dart index f340f4e49..80efe92b3 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/error.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/error.dart @@ -5,42 +5,39 @@ import 'package:polkadart/scale_codec.dart' as _i1; /// Error for the treasury pallet. enum Error { - /// Proposer's balance is too low. - insufficientProposersBalance('InsufficientProposersBalance', 0), - /// No proposal, bounty or spend at that index. - invalidIndex('InvalidIndex', 1), + invalidIndex('InvalidIndex', 0), /// Too many approvals in the queue. - tooManyApprovals('TooManyApprovals', 2), + tooManyApprovals('TooManyApprovals', 1), /// The spend origin is valid but the amount it is allowed to spend is lower than the /// amount to be spent. - insufficientPermission('InsufficientPermission', 3), + insufficientPermission('InsufficientPermission', 2), /// Proposal has not been approved. - proposalNotApproved('ProposalNotApproved', 4), + proposalNotApproved('ProposalNotApproved', 3), /// The balance of the asset kind is not convertible to the balance of the native asset. - failedToConvertBalance('FailedToConvertBalance', 5), + failedToConvertBalance('FailedToConvertBalance', 4), /// The spend has expired and cannot be claimed. - spendExpired('SpendExpired', 6), + spendExpired('SpendExpired', 5), /// The spend is not yet eligible for payout. - earlyPayout('EarlyPayout', 7), + earlyPayout('EarlyPayout', 6), /// The payment has already been attempted. - alreadyAttempted('AlreadyAttempted', 8), + alreadyAttempted('AlreadyAttempted', 7), /// There was some issue with the mechanism of payment. - payoutError('PayoutError', 9), + payoutError('PayoutError', 8), /// The payout was not yet attempted/claimed. - notAttempted('NotAttempted', 10), + notAttempted('NotAttempted', 9), /// The payment has neither failed nor succeeded yet. - inconclusive('Inconclusive', 11); + inconclusive('Inconclusive', 10); const Error( this.variantName, @@ -71,28 +68,26 @@ class $ErrorCodec with _i1.Codec { final index = _i1.U8Codec.codec.decode(input); switch (index) { case 0: - return Error.insufficientProposersBalance; - case 1: return Error.invalidIndex; - case 2: + case 1: return Error.tooManyApprovals; - case 3: + case 2: return Error.insufficientPermission; - case 4: + case 3: return Error.proposalNotApproved; - case 5: + case 4: return Error.failedToConvertBalance; - case 6: + case 5: return Error.spendExpired; - case 7: + case 6: return Error.earlyPayout; - case 8: + case 7: return Error.alreadyAttempted; - case 9: + case 8: return Error.payoutError; - case 10: + case 9: return Error.notAttempted; - case 11: + case 10: return Error.inconclusive; default: throw Exception('Error: Invalid variant index: "$index"'); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/event.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/event.dart index e76814ff0..b6637ef4f 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/event.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/event.dart @@ -34,10 +34,6 @@ abstract class Event { class $Event { const $Event(); - Proposed proposed({required int proposalIndex}) { - return Proposed(proposalIndex: proposalIndex); - } - Spending spending({required BigInt budgetRemaining}) { return Spending(budgetRemaining: budgetRemaining); } @@ -54,16 +50,6 @@ class $Event { ); } - Rejected rejected({ - required int proposalIndex, - required BigInt slashed, - }) { - return Rejected( - proposalIndex: proposalIndex, - slashed: slashed, - ); - } - Burnt burnt({required BigInt burntFunds}) { return Burnt(burntFunds: burntFunds); } @@ -153,32 +139,28 @@ class $EventCodec with _i1.Codec { final index = _i1.U8Codec.codec.decode(input); switch (index) { case 0: - return Proposed._decode(input); - case 1: return Spending._decode(input); - case 2: + case 1: return Awarded._decode(input); - case 3: - return Rejected._decode(input); - case 4: + case 2: return Burnt._decode(input); - case 5: + case 3: return Rollover._decode(input); - case 6: + case 4: return Deposit._decode(input); - case 7: + case 5: return SpendApproved._decode(input); - case 8: + case 6: return UpdatedInactive._decode(input); - case 9: + case 7: return AssetSpendApproved._decode(input); - case 10: + case 8: return AssetSpendVoided._decode(input); - case 11: + case 9: return Paid._decode(input); - case 12: + case 10: return PaymentFailed._decode(input); - case 13: + case 11: return SpendProcessed._decode(input); default: throw Exception('Event: Invalid variant index: "$index"'); @@ -191,18 +173,12 @@ class $EventCodec with _i1.Codec { _i1.Output output, ) { switch (value.runtimeType) { - case Proposed: - (value as Proposed).encodeTo(output); - break; case Spending: (value as Spending).encodeTo(output); break; case Awarded: (value as Awarded).encodeTo(output); break; - case Rejected: - (value as Rejected).encodeTo(output); - break; case Burnt: (value as Burnt).encodeTo(output); break; @@ -241,14 +217,10 @@ class $EventCodec with _i1.Codec { @override int sizeHint(Event value) { switch (value.runtimeType) { - case Proposed: - return (value as Proposed)._sizeHint(); case Spending: return (value as Spending)._sizeHint(); case Awarded: return (value as Awarded)._sizeHint(); - case Rejected: - return (value as Rejected)._sizeHint(); case Burnt: return (value as Burnt)._sizeHint(); case Rollover: @@ -275,51 +247,6 @@ class $EventCodec with _i1.Codec { } } -/// New proposal. -class Proposed extends Event { - const Proposed({required this.proposalIndex}); - - factory Proposed._decode(_i1.Input input) { - return Proposed(proposalIndex: _i1.U32Codec.codec.decode(input)); - } - - /// ProposalIndex - final int proposalIndex; - - @override - Map> toJson() => { - 'Proposed': {'proposalIndex': proposalIndex} - }; - - int _sizeHint() { - int size = 1; - size = size + _i1.U32Codec.codec.sizeHint(proposalIndex); - return size; - } - - void encodeTo(_i1.Output output) { - _i1.U8Codec.codec.encodeTo( - 0, - output, - ); - _i1.U32Codec.codec.encodeTo( - proposalIndex, - output, - ); - } - - @override - bool operator ==(Object other) => - identical( - this, - other, - ) || - other is Proposed && other.proposalIndex == proposalIndex; - - @override - int get hashCode => proposalIndex.hashCode; -} - /// We have ended a spend period and will now allocate funds. class Spending extends Event { const Spending({required this.budgetRemaining}); @@ -344,7 +271,7 @@ class Spending extends Event { void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 1, + 0, output, ); _i1.U128Codec.codec.encodeTo( @@ -409,7 +336,7 @@ class Awarded extends Event { void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 2, + 1, output, ); _i1.U32Codec.codec.encodeTo( @@ -448,71 +375,6 @@ class Awarded extends Event { ); } -/// A proposal was rejected; funds were slashed. -class Rejected extends Event { - const Rejected({ - required this.proposalIndex, - required this.slashed, - }); - - factory Rejected._decode(_i1.Input input) { - return Rejected( - proposalIndex: _i1.U32Codec.codec.decode(input), - slashed: _i1.U128Codec.codec.decode(input), - ); - } - - /// ProposalIndex - final int proposalIndex; - - /// BalanceOf - final BigInt slashed; - - @override - Map> toJson() => { - 'Rejected': { - 'proposalIndex': proposalIndex, - 'slashed': slashed, - } - }; - - int _sizeHint() { - int size = 1; - size = size + _i1.U32Codec.codec.sizeHint(proposalIndex); - size = size + _i1.U128Codec.codec.sizeHint(slashed); - return size; - } - - void encodeTo(_i1.Output output) { - _i1.U8Codec.codec.encodeTo( - 3, - output, - ); - _i1.U32Codec.codec.encodeTo( - proposalIndex, - output, - ); - _i1.U128Codec.codec.encodeTo( - slashed, - output, - ); - } - - @override - bool operator ==(Object other) => - identical( - this, - other, - ) || - other is Rejected && other.proposalIndex == proposalIndex && other.slashed == slashed; - - @override - int get hashCode => Object.hash( - proposalIndex, - slashed, - ); -} - /// Some of our funds have been burnt. class Burnt extends Event { const Burnt({required this.burntFunds}); @@ -537,7 +399,7 @@ class Burnt extends Event { void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 4, + 2, output, ); _i1.U128Codec.codec.encodeTo( @@ -582,7 +444,7 @@ class Rollover extends Event { void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 5, + 3, output, ); _i1.U128Codec.codec.encodeTo( @@ -627,7 +489,7 @@ class Deposit extends Event { void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 6, + 4, output, ); _i1.U128Codec.codec.encodeTo( @@ -692,7 +554,7 @@ class SpendApproved extends Event { void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 7, + 5, output, ); _i1.U32Codec.codec.encodeTo( @@ -768,7 +630,7 @@ class UpdatedInactive extends Event { void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 8, + 6, output, ); _i1.U128Codec.codec.encodeTo( @@ -861,7 +723,7 @@ class AssetSpendApproved extends Event { void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 9, + 7, output, ); _i1.U32Codec.codec.encodeTo( @@ -942,7 +804,7 @@ class AssetSpendVoided extends Event { void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 10, + 8, output, ); _i1.U32Codec.codec.encodeTo( @@ -1000,7 +862,7 @@ class Paid extends Event { void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 11, + 9, output, ); _i1.U32Codec.codec.encodeTo( @@ -1065,7 +927,7 @@ class PaymentFailed extends Event { void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 12, + 10, output, ); _i1.U32Codec.codec.encodeTo( @@ -1118,7 +980,7 @@ class SpendProcessed extends Event { void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 13, + 11, output, ); _i1.U32Codec.codec.encodeTo( diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_utility/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_utility/pallet/call.dart index df43b4a38..04d9c1872 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_utility/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_utility/pallet/call.dart @@ -153,7 +153,24 @@ class $CallCodec with _i1.Codec { } } -/// See [`Pallet::batch`]. +/// Send a batch of dispatch calls. +/// +/// May be called from any origin except `None`. +/// +/// - `calls`: The calls to be dispatched from the same origin. The number of call must not +/// exceed the constant: `batched_calls_limit` (available in constant metadata). +/// +/// If origin is root then the calls are dispatched without checking origin filter. (This +/// includes bypassing `frame_system::Config::BaseCallFilter`). +/// +/// ## Complexity +/// - O(C) where C is the number of calls to be batched. +/// +/// This will return `Ok` in all circumstances. To determine the success of the batch, an +/// event is deposited. If a call failed and the batch was interrupted, then the +/// `BatchInterrupted` event is deposited, along with the number of successful calls made +/// and the error of the failed call. If all were successful, then the `BatchCompleted` +/// event is deposited. class Batch extends Call { const Batch({required this.calls}); @@ -202,7 +219,19 @@ class Batch extends Call { int get hashCode => calls.hashCode; } -/// See [`Pallet::as_derivative`]. +/// Send a call through an indexed pseudonym of the sender. +/// +/// Filter from origin are passed along. The call will be dispatched with an origin which +/// use the same filter as the origin of this call. +/// +/// NOTE: If you need to ensure that any account-based filtering is not honored (i.e. +/// because you expect `proxy` to have been used prior in the call stack and you do not want +/// the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1` +/// in the Multisig pallet instead. +/// +/// NOTE: Prior to version *12, this was called `as_limited_sub`. +/// +/// The dispatch origin for this call must be _Signed_. class AsDerivative extends Call { const AsDerivative({ required this.index, @@ -267,7 +296,19 @@ class AsDerivative extends Call { ); } -/// See [`Pallet::batch_all`]. +/// Send a batch of dispatch calls and atomically execute them. +/// The whole transaction will rollback and fail if any of the calls failed. +/// +/// May be called from any origin except `None`. +/// +/// - `calls`: The calls to be dispatched from the same origin. The number of call must not +/// exceed the constant: `batched_calls_limit` (available in constant metadata). +/// +/// If origin is root then the calls are dispatched without checking origin filter. (This +/// includes bypassing `frame_system::Config::BaseCallFilter`). +/// +/// ## Complexity +/// - O(C) where C is the number of calls to be batched. class BatchAll extends Call { const BatchAll({required this.calls}); @@ -316,7 +357,12 @@ class BatchAll extends Call { int get hashCode => calls.hashCode; } -/// See [`Pallet::dispatch_as`]. +/// Dispatches a function call with a provided origin. +/// +/// The dispatch origin for this call must be _Root_. +/// +/// ## Complexity +/// - O(1). class DispatchAs extends Call { const DispatchAs({ required this.asOrigin, @@ -381,7 +427,19 @@ class DispatchAs extends Call { ); } -/// See [`Pallet::force_batch`]. +/// Send a batch of dispatch calls. +/// Unlike `batch`, it allows errors and won't interrupt. +/// +/// May be called from any origin except `None`. +/// +/// - `calls`: The calls to be dispatched from the same origin. The number of call must not +/// exceed the constant: `batched_calls_limit` (available in constant metadata). +/// +/// If origin is root then the calls are dispatch without checking origin filter. (This +/// includes bypassing `frame_system::Config::BaseCallFilter`). +/// +/// ## Complexity +/// - O(C) where C is the number of calls to be batched. class ForceBatch extends Call { const ForceBatch({required this.calls}); @@ -430,7 +488,12 @@ class ForceBatch extends Call { int get hashCode => calls.hashCode; } -/// See [`Pallet::with_weight`]. +/// Dispatch a function call with a specified weight. +/// +/// This function does not check the weight of the call, and instead allows the +/// Root origin to specify the weight of the call. +/// +/// The dispatch origin for this call must be _Root_. class WithWeight extends Call { const WithWeight({ required this.call, diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_consensus_grandpa/app/public.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_consensus_grandpa/app/public.dart index a47097640..f18ca8d03 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_consensus_grandpa/app/public.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_consensus_grandpa/app/public.dart @@ -1,24 +1,22 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:polkadart/scale_codec.dart' as _i2; +import 'package:polkadart/scale_codec.dart' as _i1; -import '../../sp_core/ed25519/public.dart' as _i1; +typedef Public = List; -typedef Public = _i1.Public; - -class PublicCodec with _i2.Codec { +class PublicCodec with _i1.Codec { const PublicCodec(); @override - Public decode(_i2.Input input) { - return const _i2.U8ArrayCodec(32).decode(input); + Public decode(_i1.Input input) { + return const _i1.U8ArrayCodec(32).decode(input); } @override void encodeTo( Public value, - _i2.Output output, + _i1.Output output, ) { - const _i2.U8ArrayCodec(32).encodeTo( + const _i1.U8ArrayCodec(32).encodeTo( value, output, ); @@ -26,6 +24,6 @@ class PublicCodec with _i2.Codec { @override int sizeHint(Public value) { - return const _i1.PublicCodec().sizeHint(value); + return const _i1.U8ArrayCodec(32).sizeHint(value); } } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_consensus_grandpa/app/signature.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_consensus_grandpa/app/signature.dart index eeb4c0304..7cf14dea1 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_consensus_grandpa/app/signature.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_consensus_grandpa/app/signature.dart @@ -1,24 +1,22 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:polkadart/scale_codec.dart' as _i2; +import 'package:polkadart/scale_codec.dart' as _i1; -import '../../sp_core/ed25519/signature.dart' as _i1; +typedef Signature = List; -typedef Signature = _i1.Signature; - -class SignatureCodec with _i2.Codec { +class SignatureCodec with _i1.Codec { const SignatureCodec(); @override - Signature decode(_i2.Input input) { - return const _i2.U8ArrayCodec(64).decode(input); + Signature decode(_i1.Input input) { + return const _i1.U8ArrayCodec(64).decode(input); } @override void encodeTo( Signature value, - _i2.Output output, + _i1.Output output, ) { - const _i2.U8ArrayCodec(64).encodeTo( + const _i1.U8ArrayCodec(64).encodeTo( value, output, ); @@ -26,6 +24,6 @@ class SignatureCodec with _i2.Codec { @override int sizeHint(Signature value) { - return const _i1.SignatureCodec().sizeHint(value); + return const _i1.U8ArrayCodec(64).sizeHint(value); } } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_consensus_grandpa/equivocation.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_consensus_grandpa/equivocation.dart index 9342d2d99..c8ffed1a6 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_consensus_grandpa/equivocation.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_consensus_grandpa/equivocation.dart @@ -95,8 +95,8 @@ class Prevote extends Equivocation { return Prevote(_i3.Equivocation.codec.decode(input)); } - /// grandpa::Equivocation, - ///AuthoritySignature> + /// finality_grandpa::Equivocation, AuthoritySignature,> final _i3.Equivocation value0; @override @@ -138,8 +138,8 @@ class Precommit extends Equivocation { return Precommit(_i4.Equivocation.codec.decode(input)); } - /// grandpa::Equivocation, - ///AuthoritySignature> + /// finality_grandpa::Equivocation, AuthoritySignature,> final _i4.Equivocation value0; @override diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_runtime/multi_signature.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_runtime/multi_signature.dart index 64a3ab4c8..61e3ea08b 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_runtime/multi_signature.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_runtime/multi_signature.dart @@ -2,11 +2,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -import 'package:quiver/collection.dart' as _i6; - -import '../sp_core/ecdsa/signature.dart' as _i5; -import '../sp_core/ed25519/signature.dart' as _i3; -import '../sp_core/sr25519/signature.dart' as _i4; +import 'package:quiver/collection.dart' as _i3; abstract class MultiSignature { const MultiSignature(); @@ -35,15 +31,15 @@ abstract class MultiSignature { class $MultiSignature { const $MultiSignature(); - Ed25519 ed25519(_i3.Signature value0) { + Ed25519 ed25519(List value0) { return Ed25519(value0); } - Sr25519 sr25519(_i4.Signature value0) { + Sr25519 sr25519(List value0) { return Sr25519(value0); } - Ecdsa ecdsa(_i5.Signature value0) { + Ecdsa ecdsa(List value0) { return Ecdsa(value0); } } @@ -109,14 +105,14 @@ class Ed25519 extends MultiSignature { } /// ed25519::Signature - final _i3.Signature value0; + final List value0; @override Map> toJson() => {'Ed25519': value0.toList()}; int _sizeHint() { int size = 1; - size = size + const _i3.SignatureCodec().sizeHint(value0); + size = size + const _i1.U8ArrayCodec(64).sizeHint(value0); return size; } @@ -138,7 +134,7 @@ class Ed25519 extends MultiSignature { other, ) || other is Ed25519 && - _i6.listsEqual( + _i3.listsEqual( other.value0, value0, ); @@ -155,14 +151,14 @@ class Sr25519 extends MultiSignature { } /// sr25519::Signature - final _i4.Signature value0; + final List value0; @override Map> toJson() => {'Sr25519': value0.toList()}; int _sizeHint() { int size = 1; - size = size + const _i4.SignatureCodec().sizeHint(value0); + size = size + const _i1.U8ArrayCodec(64).sizeHint(value0); return size; } @@ -184,7 +180,7 @@ class Sr25519 extends MultiSignature { other, ) || other is Sr25519 && - _i6.listsEqual( + _i3.listsEqual( other.value0, value0, ); @@ -201,14 +197,14 @@ class Ecdsa extends MultiSignature { } /// ecdsa::Signature - final _i5.Signature value0; + final List value0; @override Map> toJson() => {'Ecdsa': value0.toList()}; int _sizeHint() { int size = 1; - size = size + const _i5.SignatureCodec().sizeHint(value0); + size = size + const _i1.U8ArrayCodec(65).sizeHint(value0); return size; } @@ -230,7 +226,7 @@ class Ecdsa extends MultiSignature { other, ) || other is Ecdsa && - _i6.listsEqual( + _i3.listsEqual( other.value0, value0, ); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/tuples_2.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/tuples_2.dart index e1f111512..2aa0b44d0 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/tuples_2.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/tuples_2.dart @@ -1,8 +1,8 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:polkadart/scale_codec.dart' as _i1; -class Tuple7 { - const Tuple7( +class Tuple8 { + const Tuple8( this.value0, this.value1, this.value2, @@ -10,6 +10,7 @@ class Tuple7 { this.value4, this.value5, this.value6, + this.value7, ); final T0 value0; @@ -25,10 +26,12 @@ class Tuple7 { final T5 value5; final T6 value6; + + final T7 value7; } -class Tuple7Codec with _i1.Codec> { - const Tuple7Codec( +class Tuple8Codec with _i1.Codec> { + const Tuple8Codec( this.codec0, this.codec1, this.codec2, @@ -36,6 +39,7 @@ class Tuple7Codec with _i1.Codec codec0; @@ -52,9 +56,11 @@ class Tuple7Codec with _i1.Codec codec6; + final _i1.Codec codec7; + @override void encodeTo( - Tuple7 tuple, + Tuple8 tuple, _i1.Output output, ) { codec0.encodeTo(tuple.value0, output); @@ -64,11 +70,12 @@ class Tuple7Codec with _i1.Codec decode(_i1.Input input) { - return Tuple7( + Tuple8 decode(_i1.Input input) { + return Tuple8( codec0.decode(input), codec1.decode(input), codec2.decode(input), @@ -76,11 +83,12 @@ class Tuple7Codec with _i1.Codec tuple) { + int sizeHint(Tuple8 tuple) { int size = 0; size += codec0.sizeHint(tuple.value0); size += codec1.sizeHint(tuple.value1); @@ -89,6 +97,7 @@ class Tuple7Codec with _i1.Codec