diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2731f1568d..30b80ab257 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -110,7 +110,7 @@ jobs: BRANCH=$(echo -n '${{ env.LABEL }}' | cut -d ':' -f2-) fi - URL_BRANCH=$(echo -n "$BRANCH" | tr -d '#' | tr -c '[:alnum:]' '-' | tr '[:upper:]' '[:lower:]') + URL_BRANCH=$(echo -n "$BRANCH" | sed 's/\//-/' | tr -d '/#' | tr -c '[:alnum:]' '-' | tr '[:upper:]' '[:lower:]') SUBDOMAIN="${{ env.PROJECT }}-${{ env.PREFIX }}-$URL_BRANCH-joystream" if [ ${#SUBDOMAIN} -gt 63 ]; then diff --git a/.yarn/patches/@joystream-types-npm-4.3.0-542438a0b6.patch b/.yarn/patches/@joystream-types-npm-4.3.0-542438a0b6.patch new file mode 100644 index 0000000000..70a22ab3b8 --- /dev/null +++ b/.yarn/patches/@joystream-types-npm-4.3.0-542438a0b6.patch @@ -0,0 +1,526 @@ +diff --git a/lib/augment/augment-api-consts.d.ts b/lib/augment/augment-api-consts.d.ts +index 59edee6fd28f10b7387854cbd268af5d81c32e95..a941f6061303bdfdd7dcb0f11d5ae7f13ac86ccc 100644 +--- a/lib/augment/augment-api-consts.d.ts ++++ b/lib/augment/augment-api-consts.d.ts +@@ -545,6 +545,10 @@ declare module '@polkadot/api-base/types/consts' { + * Exports 'Create Working Group Lead Opening' proposal parameters. + **/ + createWorkingGroupLeadOpeningProposalParameters: PalletProposalsEngineProposalParameters & AugmentedConst; ++ /** ++ * Decrease Council budget parameters ++ **/ ++ decreaseCouncilBudgetProposalParameters: PalletProposalsEngineProposalParameters & AugmentedConst; + /** + * Exports 'Decrease Working Group Lead Stake' proposal parameters. + **/ +@@ -595,6 +599,9 @@ declare module '@polkadot/api-base/types/consts' { + * Exports 'Set Membership Price' proposal parameters. + **/ + setMembershipPriceProposalParameters: PalletProposalsEngineProposalParameters & AugmentedConst; ++ /** ++ * Set Pallet Frozen status ++ **/ + setPalletFozenStatusProposalParameters: PalletProposalsEngineProposalParameters & AugmentedConst; + setReferralCutProposalParameters: PalletProposalsEngineProposalParameters & AugmentedConst; + /** +diff --git a/lib/augment/augment-api-errors.d.ts b/lib/augment/augment-api-errors.d.ts +index 212fa506e92851c9363da175227e51acd82d7b7b..0df1bc42fa97274cc2cd093e6756b752ed584baa 100644 +--- a/lib/augment/augment-api-errors.d.ts ++++ b/lib/augment/augment-api-errors.d.ts +@@ -1051,6 +1051,10 @@ declare module '@polkadot/api-base/types/errors' { + * The member is not a councilor. + **/ + NotCouncilor: AugmentedError; ++ /** ++ * Cannot reduce the budget by the given amount. ++ **/ ++ ReductionAmountTooLarge: AugmentedError; + /** + * The same account is recieving funds from the same request twice + **/ +@@ -2561,6 +2565,10 @@ declare module '@polkadot/api-base/types/errors' { + * Invalid working group budget capacity parameter + **/ + InvalidWorkingGroupBudgetCapacity: AugmentedError; ++ /** ++ * Reduction Amount Zero ++ **/ ++ ReductionAmountZero: AugmentedError; + /** + * Require root origin in extrinsics + **/ +diff --git a/lib/augment/augment-api-events.d.ts b/lib/augment/augment-api-events.d.ts +index 59ff772d793c8018d05f85f7be7f8ff957e7e860..4718e7187ae45d1193bb24b76f025ec7ff29df3b 100644 +--- a/lib/augment/augment-api-events.d.ts ++++ b/lib/augment/augment-api-events.d.ts +@@ -737,6 +737,12 @@ declare module '@polkadot/api-base/types/events' { + * Candidate remark message + **/ + CandidateRemarked: AugmentedEvent; ++ /** ++ * Councilor budget has been decreased ++ * Params: ++ * - Reduction amount ++ **/ ++ CouncilBudgetDecreased: AugmentedEvent; + /** + * Fund the council budget. + * Params: +diff --git a/lib/augment/augment-api-tx.d.ts b/lib/augment/augment-api-tx.d.ts +index 5867fa5553c31df55802a85b9090194665948706..91456ba5cc66e26763a3813159cd3b1fdbe5e636 100644 +--- a/lib/augment/augment-api-tx.d.ts ++++ b/lib/augment/augment-api-tx.d.ts +@@ -2058,6 +2058,18 @@ declare module '@polkadot/api-base/types/submittable' { + * # + **/ + councilorRemark: AugmentedSubmittable<(councilorId: u64 | AnyNumber | Uint8Array, msg: Bytes | string | Uint8Array) => SubmittableExtrinsic, [u64, Bytes]>; ++ /** ++ * Decrease the council total budget ++ * ++ * # ++ * ++ * ## weight ++ * `O (1)` ++ * - db: ++ * - `O(1)` doesn't depend on the state or parameters ++ * # ++ **/ ++ decreaseCouncilBudget: AugmentedSubmittable<(reductionAmount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u128]>; + /** + * Fund the council budget by a member. + * +@@ -4880,6 +4892,8 @@ declare module '@polkadot/api-base/types/submittable' { + UpdateChannelPayouts: any; + } | { + SetPalletFozenStatus: any; ++ } | { ++ DecreaseCouncilBudget: any; + } | string | Uint8Array) => SubmittableExtrinsic, [PalletProposalsCodexGeneralProposalParams, PalletProposalsCodexProposalDetails]>; + }; + proposalsDiscussion: { +diff --git a/lib/augment/lookup.d.ts b/lib/augment/lookup.d.ts +index 542ca8d27f03154d9b777e44b9f99ec1af5934f1..8912bf744469466a6cb83aae87a18005b4205ee4 100644 +--- a/lib/augment/lookup.d.ts ++++ b/lib/augment/lookup.d.ts +@@ -539,6 +539,7 @@ declare const _default: { + BudgetRefillPlanned: string; + BudgetIncrementUpdated: string; + CouncilorRewardUpdated: string; ++ CouncilBudgetDecreased: string; + RequestFunded: string; + CouncilBudgetFunded: string; + CouncilorRemarked: string; +@@ -1508,6 +1509,7 @@ declare const _default: { + UpdateGlobalNftLimit: string; + UpdateChannelPayouts: string; + SetPalletFozenStatus: string; ++ DecreaseCouncilBudget: string; + }; + }; + /** +@@ -2629,6 +2631,9 @@ declare const _default: { + set_councilor_reward: { + councilorReward: string; + }; ++ decrease_council_budget: { ++ reductionAmount: string; ++ }; + funding_request: { + fundingRequests: string; + }; +diff --git a/lib/augment/types-lookup.d.ts b/lib/augment/types-lookup.d.ts +index acdce735ed42cbad308438b176a7a04cf74a2cc2..09005c39796cdc1bca81c0fc7c400c2a4089ce72 100644 +--- a/lib/augment/types-lookup.d.ts ++++ b/lib/augment/types-lookup.d.ts +@@ -543,6 +543,8 @@ declare module '@polkadot/types/lookup' { + readonly asBudgetIncrementUpdated: u128; + readonly isCouncilorRewardUpdated: boolean; + readonly asCouncilorRewardUpdated: u128; ++ readonly isCouncilBudgetDecreased: boolean; ++ readonly asCouncilBudgetDecreased: u128; + readonly isRequestFunded: boolean; + readonly asRequestFunded: ITuple<[AccountId32, u128]>; + readonly isCouncilBudgetFunded: boolean; +@@ -551,7 +553,7 @@ declare module '@polkadot/types/lookup' { + readonly asCouncilorRemarked: ITuple<[u64, Bytes]>; + readonly isCandidateRemarked: boolean; + readonly asCandidateRemarked: ITuple<[u64, Bytes]>; +- readonly type: 'AnnouncingPeriodStarted' | 'NotEnoughCandidates' | 'VotingPeriodStarted' | 'NewCandidate' | 'NewCouncilElected' | 'NewCouncilNotElected' | 'CandidacyStakeRelease' | 'CandidacyWithdraw' | 'CandidacyNoteSet' | 'RewardPayment' | 'BudgetBalanceSet' | 'BudgetRefill' | 'BudgetRefillPlanned' | 'BudgetIncrementUpdated' | 'CouncilorRewardUpdated' | 'RequestFunded' | 'CouncilBudgetFunded' | 'CouncilorRemarked' | 'CandidateRemarked'; ++ readonly type: 'AnnouncingPeriodStarted' | 'NotEnoughCandidates' | 'VotingPeriodStarted' | 'NewCandidate' | 'NewCouncilElected' | 'NewCouncilNotElected' | 'CandidacyStakeRelease' | 'CandidacyWithdraw' | 'CandidacyNoteSet' | 'RewardPayment' | 'BudgetBalanceSet' | 'BudgetRefill' | 'BudgetRefillPlanned' | 'BudgetIncrementUpdated' | 'CouncilorRewardUpdated' | 'CouncilBudgetDecreased' | 'RequestFunded' | 'CouncilBudgetFunded' | 'CouncilorRemarked' | 'CandidateRemarked'; + } + /** @name PalletReferendumRawEvent (70) */ + interface PalletReferendumRawEvent extends Enum { +@@ -1619,7 +1621,9 @@ declare module '@polkadot/types/lookup' { + readonly asUpdateChannelPayouts: PalletContentUpdateChannelPayoutsParametersRecord; + readonly isSetPalletFozenStatus: boolean; + readonly asSetPalletFozenStatus: ITuple<[bool, PalletCommonFreezablePallet]>; +- readonly type: 'Signal' | 'RuntimeUpgrade' | 'FundingRequest' | 'SetMaxValidatorCount' | 'CreateWorkingGroupLeadOpening' | 'FillWorkingGroupLeadOpening' | 'UpdateWorkingGroupBudget' | 'DecreaseWorkingGroupLeadStake' | 'SlashWorkingGroupLead' | 'SetWorkingGroupLeadReward' | 'TerminateWorkingGroupLead' | 'AmendConstitution' | 'CancelWorkingGroupLeadOpening' | 'SetMembershipPrice' | 'SetCouncilBudgetIncrement' | 'SetCouncilorReward' | 'SetInitialInvitationBalance' | 'SetInitialInvitationCount' | 'SetMembershipLeadInvitationQuota' | 'SetReferralCut' | 'VetoProposal' | 'UpdateGlobalNftLimit' | 'UpdateChannelPayouts' | 'SetPalletFozenStatus'; ++ readonly isDecreaseCouncilBudget: boolean; ++ readonly asDecreaseCouncilBudget: u128; ++ readonly type: 'Signal' | 'RuntimeUpgrade' | 'FundingRequest' | 'SetMaxValidatorCount' | 'CreateWorkingGroupLeadOpening' | 'FillWorkingGroupLeadOpening' | 'UpdateWorkingGroupBudget' | 'DecreaseWorkingGroupLeadStake' | 'SlashWorkingGroupLead' | 'SetWorkingGroupLeadReward' | 'TerminateWorkingGroupLead' | 'AmendConstitution' | 'CancelWorkingGroupLeadOpening' | 'SetMembershipPrice' | 'SetCouncilBudgetIncrement' | 'SetCouncilorReward' | 'SetInitialInvitationBalance' | 'SetInitialInvitationCount' | 'SetMembershipLeadInvitationQuota' | 'SetReferralCut' | 'VetoProposal' | 'UpdateGlobalNftLimit' | 'UpdateChannelPayouts' | 'SetPalletFozenStatus' | 'DecreaseCouncilBudget'; + } + /** @name PalletCommonFundingRequestParameters (214) */ + interface PalletCommonFundingRequestParameters extends Struct { +@@ -2849,6 +2853,10 @@ declare module '@polkadot/types/lookup' { + readonly asSetCouncilorReward: { + readonly councilorReward: u128; + } & Struct; ++ readonly isDecreaseCouncilBudget: boolean; ++ readonly asDecreaseCouncilBudget: { ++ readonly reductionAmount: u128; ++ } & Struct; + readonly isFundingRequest: boolean; + readonly asFundingRequest: { + readonly fundingRequests: Vec; +@@ -2869,7 +2877,7 @@ declare module '@polkadot/types/lookup' { + readonly candidateId: u64; + readonly msg: Bytes; + } & Struct; +- readonly type: 'AnnounceCandidacy' | 'ReleaseCandidacyStake' | 'WithdrawCandidacy' | 'SetCandidacyNote' | 'SetBudget' | 'PlanBudgetRefill' | 'SetBudgetIncrement' | 'SetCouncilorReward' | 'FundingRequest' | 'FundCouncilBudget' | 'CouncilorRemark' | 'CandidateRemark'; ++ readonly type: 'AnnounceCandidacy' | 'ReleaseCandidacyStake' | 'WithdrawCandidacy' | 'SetCandidacyNote' | 'SetBudget' | 'PlanBudgetRefill' | 'SetBudgetIncrement' | 'SetCouncilorReward' | 'DecreaseCouncilBudget' | 'FundingRequest' | 'FundCouncilBudget' | 'CouncilorRemark' | 'CandidateRemark'; + } + /** @name PalletReferendumCall (380) */ + interface PalletReferendumCall extends Enum { +@@ -4441,7 +4449,8 @@ declare module '@polkadot/types/lookup' { + readonly isZeroTokensFunding: boolean; + readonly isCandidateDoesNotExist: boolean; + readonly isInsufficientBalanceForTransfer: boolean; +- readonly type: 'ArithmeticError' | 'BadOrigin' | 'CantCandidateNow' | 'CantReleaseStakeNow' | 'CandidacyStakeTooLow' | 'CantCandidateTwice' | 'ConflictingStake' | 'StakeStillNeeded' | 'NoStake' | 'InsufficientBalanceForStaking' | 'CantVoteForYourself' | 'MemberIdNotMatchAccount' | 'InvalidAccountToStakeReuse' | 'NotCandidatingNow' | 'CantWithdrawCandidacyNow' | 'NotCouncilor' | 'InsufficientFundsForFundingRequest' | 'ZeroBalanceFundRequest' | 'RepeatedFundRequestAccount' | 'EmptyFundingRequests' | 'InsufficientTokensForFunding' | 'ZeroTokensFunding' | 'CandidateDoesNotExist' | 'InsufficientBalanceForTransfer'; ++ readonly isReductionAmountTooLarge: boolean; ++ readonly type: 'ArithmeticError' | 'BadOrigin' | 'CantCandidateNow' | 'CantReleaseStakeNow' | 'CandidacyStakeTooLow' | 'CantCandidateTwice' | 'ConflictingStake' | 'StakeStillNeeded' | 'NoStake' | 'InsufficientBalanceForStaking' | 'CantVoteForYourself' | 'MemberIdNotMatchAccount' | 'InvalidAccountToStakeReuse' | 'NotCandidatingNow' | 'CantWithdrawCandidacyNow' | 'NotCouncilor' | 'InsufficientFundsForFundingRequest' | 'ZeroBalanceFundRequest' | 'RepeatedFundRequestAccount' | 'EmptyFundingRequests' | 'InsufficientTokensForFunding' | 'ZeroTokensFunding' | 'CandidateDoesNotExist' | 'InsufficientBalanceForTransfer' | 'ReductionAmountTooLarge'; + } + /** @name PalletReferendumReferendumStage (525) */ + interface PalletReferendumReferendumStage extends Enum { +@@ -5253,7 +5262,8 @@ declare module '@polkadot/types/lookup' { + readonly isInvalidLeadApplicationId: boolean; + readonly isInvalidProposalId: boolean; + readonly isArithmeticError: boolean; +- readonly type: 'SignalProposalIsEmpty' | 'RuntimeProposalIsEmpty' | 'InvalidFundingRequestProposalBalance' | 'InvalidValidatorCount' | 'RequireRootOrigin' | 'InvalidCouncilElectionParameterCouncilSize' | 'InvalidCouncilElectionParameterCandidacyLimit' | 'InvalidCouncilElectionParameterMinVotingStake' | 'InvalidCouncilElectionParameterNewTermDuration' | 'InvalidCouncilElectionParameterMinCouncilStake' | 'InvalidCouncilElectionParameterRevealingPeriod' | 'InvalidCouncilElectionParameterVotingPeriod' | 'InvalidCouncilElectionParameterAnnouncingPeriod' | 'InvalidWorkingGroupBudgetCapacity' | 'InvalidSetLeadParameterCannotBeCouncilor' | 'SlashingStakeIsZero' | 'DecreasingStakeIsZero' | 'InsufficientFundsForBudgetUpdate' | 'InvalidFundingRequestProposalNumberOfAccount' | 'InvalidFundingRequestProposalRepeatedAccount' | 'InvalidChannelPayoutsProposalMinCashoutExceedsMaxCashout' | 'InvalidLeadWorkerId' | 'InvalidLeadOpeningId' | 'InvalidLeadApplicationId' | 'InvalidProposalId' | 'ArithmeticError'; ++ readonly isReductionAmountZero: boolean; ++ readonly type: 'SignalProposalIsEmpty' | 'RuntimeProposalIsEmpty' | 'InvalidFundingRequestProposalBalance' | 'InvalidValidatorCount' | 'RequireRootOrigin' | 'InvalidCouncilElectionParameterCouncilSize' | 'InvalidCouncilElectionParameterCandidacyLimit' | 'InvalidCouncilElectionParameterMinVotingStake' | 'InvalidCouncilElectionParameterNewTermDuration' | 'InvalidCouncilElectionParameterMinCouncilStake' | 'InvalidCouncilElectionParameterRevealingPeriod' | 'InvalidCouncilElectionParameterVotingPeriod' | 'InvalidCouncilElectionParameterAnnouncingPeriod' | 'InvalidWorkingGroupBudgetCapacity' | 'InvalidSetLeadParameterCannotBeCouncilor' | 'SlashingStakeIsZero' | 'DecreasingStakeIsZero' | 'InsufficientFundsForBudgetUpdate' | 'InvalidFundingRequestProposalNumberOfAccount' | 'InvalidFundingRequestProposalRepeatedAccount' | 'InvalidChannelPayoutsProposalMinCashoutExceedsMaxCashout' | 'InvalidLeadWorkerId' | 'InvalidLeadOpeningId' | 'InvalidLeadApplicationId' | 'InvalidProposalId' | 'ArithmeticError' | 'ReductionAmountZero'; + } + /** @name PalletWorkingGroupOpening (615) */ + interface PalletWorkingGroupOpening extends Struct { +diff --git a/lib/cjs/augment/lookup.js b/lib/cjs/augment/lookup.js +index 23d5c9d63ca89dc370c72d73c513991506d7fe40..d1dc47ce3454a4b95c310dd0335740573489174a 100644 +--- a/lib/cjs/augment/lookup.js ++++ b/lib/cjs/augment/lookup.js +@@ -544,6 +544,7 @@ exports.default = { + BudgetRefillPlanned: 'u32', + BudgetIncrementUpdated: 'u128', + CouncilorRewardUpdated: 'u128', ++ CouncilBudgetDecreased: 'u128', + RequestFunded: '(AccountId32,u128)', + CouncilBudgetFunded: '(u64,u128,Bytes)', + CouncilorRemarked: '(u64,Bytes)', +@@ -1512,7 +1513,8 @@ exports.default = { + VetoProposal: 'u32', + UpdateGlobalNftLimit: '(PalletContentNftLimitPeriod,u64)', + UpdateChannelPayouts: 'PalletContentUpdateChannelPayoutsParametersRecord', +- SetPalletFozenStatus: '(bool,PalletCommonFreezablePallet)' ++ SetPalletFozenStatus: '(bool,PalletCommonFreezablePallet)', ++ DecreaseCouncilBudget: 'u128' + } + }, + /** +@@ -2634,6 +2636,9 @@ exports.default = { + set_councilor_reward: { + councilorReward: 'u128', + }, ++ decrease_council_budget: { ++ reductionAmount: 'u128', ++ }, + funding_request: { + fundingRequests: 'Vec', + }, +@@ -4064,7 +4069,7 @@ exports.default = { + * Lookup524: pallet_council::Error + **/ + PalletCouncilError: { +- _enum: ['ArithmeticError', 'BadOrigin', 'CantCandidateNow', 'CantReleaseStakeNow', 'CandidacyStakeTooLow', 'CantCandidateTwice', 'ConflictingStake', 'StakeStillNeeded', 'NoStake', 'InsufficientBalanceForStaking', 'CantVoteForYourself', 'MemberIdNotMatchAccount', 'InvalidAccountToStakeReuse', 'NotCandidatingNow', 'CantWithdrawCandidacyNow', 'NotCouncilor', 'InsufficientFundsForFundingRequest', 'ZeroBalanceFundRequest', 'RepeatedFundRequestAccount', 'EmptyFundingRequests', 'InsufficientTokensForFunding', 'ZeroTokensFunding', 'CandidateDoesNotExist', 'InsufficientBalanceForTransfer'] ++ _enum: ['ArithmeticError', 'BadOrigin', 'CantCandidateNow', 'CantReleaseStakeNow', 'CandidacyStakeTooLow', 'CantCandidateTwice', 'ConflictingStake', 'StakeStillNeeded', 'NoStake', 'InsufficientBalanceForStaking', 'CantVoteForYourself', 'MemberIdNotMatchAccount', 'InvalidAccountToStakeReuse', 'NotCandidatingNow', 'CantWithdrawCandidacyNow', 'NotCouncilor', 'InsufficientFundsForFundingRequest', 'ZeroBalanceFundRequest', 'RepeatedFundRequestAccount', 'EmptyFundingRequests', 'InsufficientTokensForFunding', 'ZeroTokensFunding', 'CandidateDoesNotExist', 'InsufficientBalanceForTransfer', 'ReductionAmountTooLarge'] + }, + /** + * Lookup525: pallet_referendum::ReferendumStage, S>> +@@ -4572,7 +4577,7 @@ exports.default = { + * Lookup614: pallet_proposals_codex::Error + **/ + PalletProposalsCodexError: { +- _enum: ['SignalProposalIsEmpty', 'RuntimeProposalIsEmpty', 'InvalidFundingRequestProposalBalance', 'InvalidValidatorCount', 'RequireRootOrigin', 'InvalidCouncilElectionParameterCouncilSize', 'InvalidCouncilElectionParameterCandidacyLimit', 'InvalidCouncilElectionParameterMinVotingStake', 'InvalidCouncilElectionParameterNewTermDuration', 'InvalidCouncilElectionParameterMinCouncilStake', 'InvalidCouncilElectionParameterRevealingPeriod', 'InvalidCouncilElectionParameterVotingPeriod', 'InvalidCouncilElectionParameterAnnouncingPeriod', 'InvalidWorkingGroupBudgetCapacity', 'InvalidSetLeadParameterCannotBeCouncilor', 'SlashingStakeIsZero', 'DecreasingStakeIsZero', 'InsufficientFundsForBudgetUpdate', 'InvalidFundingRequestProposalNumberOfAccount', 'InvalidFundingRequestProposalRepeatedAccount', 'InvalidChannelPayoutsProposalMinCashoutExceedsMaxCashout', 'InvalidLeadWorkerId', 'InvalidLeadOpeningId', 'InvalidLeadApplicationId', 'InvalidProposalId', 'ArithmeticError'] ++ _enum: ['SignalProposalIsEmpty', 'RuntimeProposalIsEmpty', 'InvalidFundingRequestProposalBalance', 'InvalidValidatorCount', 'RequireRootOrigin', 'InvalidCouncilElectionParameterCouncilSize', 'InvalidCouncilElectionParameterCandidacyLimit', 'InvalidCouncilElectionParameterMinVotingStake', 'InvalidCouncilElectionParameterNewTermDuration', 'InvalidCouncilElectionParameterMinCouncilStake', 'InvalidCouncilElectionParameterRevealingPeriod', 'InvalidCouncilElectionParameterVotingPeriod', 'InvalidCouncilElectionParameterAnnouncingPeriod', 'InvalidWorkingGroupBudgetCapacity', 'InvalidSetLeadParameterCannotBeCouncilor', 'SlashingStakeIsZero', 'DecreasingStakeIsZero', 'InsufficientFundsForBudgetUpdate', 'InvalidFundingRequestProposalNumberOfAccount', 'InvalidFundingRequestProposalRepeatedAccount', 'InvalidChannelPayoutsProposalMinCashoutExceedsMaxCashout', 'InvalidLeadWorkerId', 'InvalidLeadOpeningId', 'InvalidLeadApplicationId', 'InvalidProposalId', 'ArithmeticError', 'ReductionAmountZero'] + }, + /** + * Lookup615: pallet_working_group::types::Opening +diff --git a/lib/mjs/augment/lookup.js b/lib/mjs/augment/lookup.js +index 7f10085159ebd54e03771940c213d9dbf9db5444..5ccd38f65f2c51283a38eb6307f06941212fbc41 100644 +--- a/lib/mjs/augment/lookup.js ++++ b/lib/mjs/augment/lookup.js +@@ -542,6 +542,7 @@ export default { + BudgetRefillPlanned: 'u32', + BudgetIncrementUpdated: 'u128', + CouncilorRewardUpdated: 'u128', ++ CouncilBudgetDecreased: 'u128', + RequestFunded: '(AccountId32,u128)', + CouncilBudgetFunded: '(u64,u128,Bytes)', + CouncilorRemarked: '(u64,Bytes)', +@@ -1510,7 +1511,8 @@ export default { + VetoProposal: 'u32', + UpdateGlobalNftLimit: '(PalletContentNftLimitPeriod,u64)', + UpdateChannelPayouts: 'PalletContentUpdateChannelPayoutsParametersRecord', +- SetPalletFozenStatus: '(bool,PalletCommonFreezablePallet)' ++ SetPalletFozenStatus: '(bool,PalletCommonFreezablePallet)', ++ DecreaseCouncilBudget: 'u128' + } + }, + /** +@@ -2632,6 +2634,9 @@ export default { + set_councilor_reward: { + councilorReward: 'u128', + }, ++ decrease_council_budget: { ++ reductionAmount: 'u128', ++ }, + funding_request: { + fundingRequests: 'Vec', + }, +@@ -4062,7 +4067,7 @@ export default { + * Lookup524: pallet_council::Error + **/ + PalletCouncilError: { +- _enum: ['ArithmeticError', 'BadOrigin', 'CantCandidateNow', 'CantReleaseStakeNow', 'CandidacyStakeTooLow', 'CantCandidateTwice', 'ConflictingStake', 'StakeStillNeeded', 'NoStake', 'InsufficientBalanceForStaking', 'CantVoteForYourself', 'MemberIdNotMatchAccount', 'InvalidAccountToStakeReuse', 'NotCandidatingNow', 'CantWithdrawCandidacyNow', 'NotCouncilor', 'InsufficientFundsForFundingRequest', 'ZeroBalanceFundRequest', 'RepeatedFundRequestAccount', 'EmptyFundingRequests', 'InsufficientTokensForFunding', 'ZeroTokensFunding', 'CandidateDoesNotExist', 'InsufficientBalanceForTransfer'] ++ _enum: ['ArithmeticError', 'BadOrigin', 'CantCandidateNow', 'CantReleaseStakeNow', 'CandidacyStakeTooLow', 'CantCandidateTwice', 'ConflictingStake', 'StakeStillNeeded', 'NoStake', 'InsufficientBalanceForStaking', 'CantVoteForYourself', 'MemberIdNotMatchAccount', 'InvalidAccountToStakeReuse', 'NotCandidatingNow', 'CantWithdrawCandidacyNow', 'NotCouncilor', 'InsufficientFundsForFundingRequest', 'ZeroBalanceFundRequest', 'RepeatedFundRequestAccount', 'EmptyFundingRequests', 'InsufficientTokensForFunding', 'ZeroTokensFunding', 'CandidateDoesNotExist', 'InsufficientBalanceForTransfer', 'ReductionAmountTooLarge'] + }, + /** + * Lookup525: pallet_referendum::ReferendumStage, S>> +@@ -4570,7 +4575,7 @@ export default { + * Lookup614: pallet_proposals_codex::Error + **/ + PalletProposalsCodexError: { +- _enum: ['SignalProposalIsEmpty', 'RuntimeProposalIsEmpty', 'InvalidFundingRequestProposalBalance', 'InvalidValidatorCount', 'RequireRootOrigin', 'InvalidCouncilElectionParameterCouncilSize', 'InvalidCouncilElectionParameterCandidacyLimit', 'InvalidCouncilElectionParameterMinVotingStake', 'InvalidCouncilElectionParameterNewTermDuration', 'InvalidCouncilElectionParameterMinCouncilStake', 'InvalidCouncilElectionParameterRevealingPeriod', 'InvalidCouncilElectionParameterVotingPeriod', 'InvalidCouncilElectionParameterAnnouncingPeriod', 'InvalidWorkingGroupBudgetCapacity', 'InvalidSetLeadParameterCannotBeCouncilor', 'SlashingStakeIsZero', 'DecreasingStakeIsZero', 'InsufficientFundsForBudgetUpdate', 'InvalidFundingRequestProposalNumberOfAccount', 'InvalidFundingRequestProposalRepeatedAccount', 'InvalidChannelPayoutsProposalMinCashoutExceedsMaxCashout', 'InvalidLeadWorkerId', 'InvalidLeadOpeningId', 'InvalidLeadApplicationId', 'InvalidProposalId', 'ArithmeticError'] ++ _enum: ['SignalProposalIsEmpty', 'RuntimeProposalIsEmpty', 'InvalidFundingRequestProposalBalance', 'InvalidValidatorCount', 'RequireRootOrigin', 'InvalidCouncilElectionParameterCouncilSize', 'InvalidCouncilElectionParameterCandidacyLimit', 'InvalidCouncilElectionParameterMinVotingStake', 'InvalidCouncilElectionParameterNewTermDuration', 'InvalidCouncilElectionParameterMinCouncilStake', 'InvalidCouncilElectionParameterRevealingPeriod', 'InvalidCouncilElectionParameterVotingPeriod', 'InvalidCouncilElectionParameterAnnouncingPeriod', 'InvalidWorkingGroupBudgetCapacity', 'InvalidSetLeadParameterCannotBeCouncilor', 'SlashingStakeIsZero', 'DecreasingStakeIsZero', 'InsufficientFundsForBudgetUpdate', 'InvalidFundingRequestProposalNumberOfAccount', 'InvalidFundingRequestProposalRepeatedAccount', 'InvalidChannelPayoutsProposalMinCashoutExceedsMaxCashout', 'InvalidLeadWorkerId', 'InvalidLeadOpeningId', 'InvalidLeadApplicationId', 'InvalidProposalId', 'ArithmeticError', 'ReductionAmountZero'] + }, + /** + * Lookup615: pallet_working_group::types::Opening +diff --git a/src/augment/augment-api-consts.ts b/src/augment/augment-api-consts.ts +index c82de3001ca3561eb2417f0d81d6239f0429ce5d..605e476ad088f6cdb49a49185c58b2a6b546bf51 100644 +--- a/src/augment/augment-api-consts.ts ++++ b/src/augment/augment-api-consts.ts +@@ -553,6 +553,10 @@ declare module '@polkadot/api-base/types/consts' { + * Exports 'Create Working Group Lead Opening' proposal parameters. + **/ + createWorkingGroupLeadOpeningProposalParameters: PalletProposalsEngineProposalParameters & AugmentedConst; ++ /** ++ * Decrease Council budget parameters ++ **/ ++ decreaseCouncilBudgetProposalParameters: PalletProposalsEngineProposalParameters & AugmentedConst; + /** + * Exports 'Decrease Working Group Lead Stake' proposal parameters. + **/ +@@ -603,6 +607,9 @@ declare module '@polkadot/api-base/types/consts' { + * Exports 'Set Membership Price' proposal parameters. + **/ + setMembershipPriceProposalParameters: PalletProposalsEngineProposalParameters & AugmentedConst; ++ /** ++ * Set Pallet Frozen status ++ **/ + setPalletFozenStatusProposalParameters: PalletProposalsEngineProposalParameters & AugmentedConst; + setReferralCutProposalParameters: PalletProposalsEngineProposalParameters & AugmentedConst; + /** +diff --git a/src/augment/augment-api-errors.ts b/src/augment/augment-api-errors.ts +index 98b5b35477a3dc227aae75109abdaa2bc6dc7d4b..ea3f7eeec6a01e7f165c2bf8a9b5f7b34b4d0e2d 100644 +--- a/src/augment/augment-api-errors.ts ++++ b/src/augment/augment-api-errors.ts +@@ -1059,6 +1059,10 @@ declare module '@polkadot/api-base/types/errors' { + * The member is not a councilor. + **/ + NotCouncilor: AugmentedError; ++ /** ++ * Cannot reduce the budget by the given amount. ++ **/ ++ ReductionAmountTooLarge: AugmentedError; + /** + * The same account is recieving funds from the same request twice + **/ +@@ -2569,6 +2573,10 @@ declare module '@polkadot/api-base/types/errors' { + * Invalid working group budget capacity parameter + **/ + InvalidWorkingGroupBudgetCapacity: AugmentedError; ++ /** ++ * Reduction Amount Zero ++ **/ ++ ReductionAmountZero: AugmentedError; + /** + * Require root origin in extrinsics + **/ +diff --git a/src/augment/augment-api-events.ts b/src/augment/augment-api-events.ts +index 26e6f1fd2f0bd3f6036ef5e1c279bc32094648e0..6c562bb6a6d17f62e1b0b01cad4c4f7af371bf7e 100644 +--- a/src/augment/augment-api-events.ts ++++ b/src/augment/augment-api-events.ts +@@ -711,6 +711,12 @@ declare module '@polkadot/api-base/types/events' { + * Candidate remark message + **/ + CandidateRemarked: AugmentedEvent; ++ /** ++ * Councilor budget has been decreased ++ * Params: ++ * - Reduction amount ++ **/ ++ CouncilBudgetDecreased: AugmentedEvent; + /** + * Fund the council budget. + * Params: +diff --git a/src/augment/augment-api-tx.ts b/src/augment/augment-api-tx.ts +index ab25a69a7cd8860a711a190a76961adcc41380fb..e20e15b13fdad15fe3b2da65122d2183fbfe77b0 100644 +--- a/src/augment/augment-api-tx.ts ++++ b/src/augment/augment-api-tx.ts +@@ -1634,6 +1634,18 @@ declare module '@polkadot/api-base/types/submittable' { + * # + **/ + councilorRemark: AugmentedSubmittable<(councilorId: u64 | AnyNumber | Uint8Array, msg: Bytes | string | Uint8Array) => SubmittableExtrinsic, [u64, Bytes]>; ++ /** ++ * Decrease the council total budget ++ * ++ * # ++ * ++ * ## weight ++ * `O (1)` ++ * - db: ++ * - `O(1)` doesn't depend on the state or parameters ++ * # ++ **/ ++ decreaseCouncilBudget: AugmentedSubmittable<(reductionAmount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u128]>; + /** + * Fund the council budget by a member. + * +@@ -4227,7 +4239,7 @@ declare module '@polkadot/api-base/types/submittable' { + * - O(1) doesn't depend on the state or parameters + * # + **/ +- createProposal: AugmentedSubmittable<(generalProposalParameters: PalletProposalsCodexGeneralProposalParams | { memberId?: any; title?: any; description?: any; stakingAccountId?: any; exactExecutionBlock?: any } | string | Uint8Array, proposalDetails: PalletProposalsCodexProposalDetails | { Signal: any } | { RuntimeUpgrade: any } | { FundingRequest: any } | { SetMaxValidatorCount: any } | { CreateWorkingGroupLeadOpening: any } | { FillWorkingGroupLeadOpening: any } | { UpdateWorkingGroupBudget: any } | { DecreaseWorkingGroupLeadStake: any } | { SlashWorkingGroupLead: any } | { SetWorkingGroupLeadReward: any } | { TerminateWorkingGroupLead: any } | { AmendConstitution: any } | { CancelWorkingGroupLeadOpening: any } | { SetMembershipPrice: any } | { SetCouncilBudgetIncrement: any } | { SetCouncilorReward: any } | { SetInitialInvitationBalance: any } | { SetInitialInvitationCount: any } | { SetMembershipLeadInvitationQuota: any } | { SetReferralCut: any } | { VetoProposal: any } | { UpdateGlobalNftLimit: any } | { UpdateChannelPayouts: any } | { SetPalletFozenStatus: any } | string | Uint8Array) => SubmittableExtrinsic, [PalletProposalsCodexGeneralProposalParams, PalletProposalsCodexProposalDetails]>; ++ createProposal: AugmentedSubmittable<(generalProposalParameters: PalletProposalsCodexGeneralProposalParams | { memberId?: any; title?: any; description?: any; stakingAccountId?: any; exactExecutionBlock?: any } | string | Uint8Array, proposalDetails: PalletProposalsCodexProposalDetails | { Signal: any } | { RuntimeUpgrade: any } | { FundingRequest: any } | { SetMaxValidatorCount: any } | { CreateWorkingGroupLeadOpening: any } | { FillWorkingGroupLeadOpening: any } | { UpdateWorkingGroupBudget: any } | { DecreaseWorkingGroupLeadStake: any } | { SlashWorkingGroupLead: any } | { SetWorkingGroupLeadReward: any } | { TerminateWorkingGroupLead: any } | { AmendConstitution: any } | { CancelWorkingGroupLeadOpening: any } | { SetMembershipPrice: any } | { SetCouncilBudgetIncrement: any } | { SetCouncilorReward: any } | { SetInitialInvitationBalance: any } | { SetInitialInvitationCount: any } | { SetMembershipLeadInvitationQuota: any } | { SetReferralCut: any } | { VetoProposal: any } | { UpdateGlobalNftLimit: any } | { UpdateChannelPayouts: any } | { SetPalletFozenStatus: any } | { DecreaseCouncilBudget: any } | string | Uint8Array) => SubmittableExtrinsic, [PalletProposalsCodexGeneralProposalParams, PalletProposalsCodexProposalDetails]>; + }; + proposalsDiscussion: { + /** +diff --git a/src/augment/lookup.ts b/src/augment/lookup.ts +index 143f41ba8e42a170842715bcfaaf4ffaa6e07954..9df1510838ab8d4003f47a0615d00055f40d936c 100644 +--- a/src/augment/lookup.ts ++++ b/src/augment/lookup.ts +@@ -544,6 +544,7 @@ export default { + BudgetRefillPlanned: 'u32', + BudgetIncrementUpdated: 'u128', + CouncilorRewardUpdated: 'u128', ++ CouncilBudgetDecreased: 'u128', + RequestFunded: '(AccountId32,u128)', + CouncilBudgetFunded: '(u64,u128,Bytes)', + CouncilorRemarked: '(u64,Bytes)', +@@ -1512,7 +1513,8 @@ export default { + VetoProposal: 'u32', + UpdateGlobalNftLimit: '(PalletContentNftLimitPeriod,u64)', + UpdateChannelPayouts: 'PalletContentUpdateChannelPayoutsParametersRecord', +- SetPalletFozenStatus: '(bool,PalletCommonFreezablePallet)' ++ SetPalletFozenStatus: '(bool,PalletCommonFreezablePallet)', ++ DecreaseCouncilBudget: 'u128' + } + }, + /** +@@ -2634,6 +2636,9 @@ export default { + set_councilor_reward: { + councilorReward: 'u128', + }, ++ decrease_council_budget: { ++ reductionAmount: 'u128', ++ }, + funding_request: { + fundingRequests: 'Vec', + }, +@@ -4064,7 +4069,7 @@ export default { + * Lookup524: pallet_council::Error + **/ + PalletCouncilError: { +- _enum: ['ArithmeticError', 'BadOrigin', 'CantCandidateNow', 'CantReleaseStakeNow', 'CandidacyStakeTooLow', 'CantCandidateTwice', 'ConflictingStake', 'StakeStillNeeded', 'NoStake', 'InsufficientBalanceForStaking', 'CantVoteForYourself', 'MemberIdNotMatchAccount', 'InvalidAccountToStakeReuse', 'NotCandidatingNow', 'CantWithdrawCandidacyNow', 'NotCouncilor', 'InsufficientFundsForFundingRequest', 'ZeroBalanceFundRequest', 'RepeatedFundRequestAccount', 'EmptyFundingRequests', 'InsufficientTokensForFunding', 'ZeroTokensFunding', 'CandidateDoesNotExist', 'InsufficientBalanceForTransfer'] ++ _enum: ['ArithmeticError', 'BadOrigin', 'CantCandidateNow', 'CantReleaseStakeNow', 'CandidacyStakeTooLow', 'CantCandidateTwice', 'ConflictingStake', 'StakeStillNeeded', 'NoStake', 'InsufficientBalanceForStaking', 'CantVoteForYourself', 'MemberIdNotMatchAccount', 'InvalidAccountToStakeReuse', 'NotCandidatingNow', 'CantWithdrawCandidacyNow', 'NotCouncilor', 'InsufficientFundsForFundingRequest', 'ZeroBalanceFundRequest', 'RepeatedFundRequestAccount', 'EmptyFundingRequests', 'InsufficientTokensForFunding', 'ZeroTokensFunding', 'CandidateDoesNotExist', 'InsufficientBalanceForTransfer', 'ReductionAmountTooLarge'] + }, + /** + * Lookup525: pallet_referendum::ReferendumStage, S>> +@@ -4572,7 +4577,7 @@ export default { + * Lookup614: pallet_proposals_codex::Error + **/ + PalletProposalsCodexError: { +- _enum: ['SignalProposalIsEmpty', 'RuntimeProposalIsEmpty', 'InvalidFundingRequestProposalBalance', 'InvalidValidatorCount', 'RequireRootOrigin', 'InvalidCouncilElectionParameterCouncilSize', 'InvalidCouncilElectionParameterCandidacyLimit', 'InvalidCouncilElectionParameterMinVotingStake', 'InvalidCouncilElectionParameterNewTermDuration', 'InvalidCouncilElectionParameterMinCouncilStake', 'InvalidCouncilElectionParameterRevealingPeriod', 'InvalidCouncilElectionParameterVotingPeriod', 'InvalidCouncilElectionParameterAnnouncingPeriod', 'InvalidWorkingGroupBudgetCapacity', 'InvalidSetLeadParameterCannotBeCouncilor', 'SlashingStakeIsZero', 'DecreasingStakeIsZero', 'InsufficientFundsForBudgetUpdate', 'InvalidFundingRequestProposalNumberOfAccount', 'InvalidFundingRequestProposalRepeatedAccount', 'InvalidChannelPayoutsProposalMinCashoutExceedsMaxCashout', 'InvalidLeadWorkerId', 'InvalidLeadOpeningId', 'InvalidLeadApplicationId', 'InvalidProposalId', 'ArithmeticError'] ++ _enum: ['SignalProposalIsEmpty', 'RuntimeProposalIsEmpty', 'InvalidFundingRequestProposalBalance', 'InvalidValidatorCount', 'RequireRootOrigin', 'InvalidCouncilElectionParameterCouncilSize', 'InvalidCouncilElectionParameterCandidacyLimit', 'InvalidCouncilElectionParameterMinVotingStake', 'InvalidCouncilElectionParameterNewTermDuration', 'InvalidCouncilElectionParameterMinCouncilStake', 'InvalidCouncilElectionParameterRevealingPeriod', 'InvalidCouncilElectionParameterVotingPeriod', 'InvalidCouncilElectionParameterAnnouncingPeriod', 'InvalidWorkingGroupBudgetCapacity', 'InvalidSetLeadParameterCannotBeCouncilor', 'SlashingStakeIsZero', 'DecreasingStakeIsZero', 'InsufficientFundsForBudgetUpdate', 'InvalidFundingRequestProposalNumberOfAccount', 'InvalidFundingRequestProposalRepeatedAccount', 'InvalidChannelPayoutsProposalMinCashoutExceedsMaxCashout', 'InvalidLeadWorkerId', 'InvalidLeadOpeningId', 'InvalidLeadApplicationId', 'InvalidProposalId', 'ArithmeticError', 'ReductionAmountZero'] + }, + /** + * Lookup615: pallet_working_group::types::Opening +diff --git a/src/augment/types-lookup.ts b/src/augment/types-lookup.ts +index a531a38dfed759679fe57c67a40242b9a7a5e5eb..d8991e52489645a42b626cfdaa58d370eb8f2bb5 100644 +--- a/src/augment/types-lookup.ts ++++ b/src/augment/types-lookup.ts +@@ -587,6 +587,8 @@ declare module '@polkadot/types/lookup' { + readonly asBudgetIncrementUpdated: u128; + readonly isCouncilorRewardUpdated: boolean; + readonly asCouncilorRewardUpdated: u128; ++ readonly isCouncilBudgetDecreased: boolean; ++ readonly asCouncilBudgetDecreased: u128; + readonly isRequestFunded: boolean; + readonly asRequestFunded: ITuple<[AccountId32, u128]>; + readonly isCouncilBudgetFunded: boolean; +@@ -595,7 +597,7 @@ declare module '@polkadot/types/lookup' { + readonly asCouncilorRemarked: ITuple<[u64, Bytes]>; + readonly isCandidateRemarked: boolean; + readonly asCandidateRemarked: ITuple<[u64, Bytes]>; +- readonly type: 'AnnouncingPeriodStarted' | 'NotEnoughCandidates' | 'VotingPeriodStarted' | 'NewCandidate' | 'NewCouncilElected' | 'NewCouncilNotElected' | 'CandidacyStakeRelease' | 'CandidacyWithdraw' | 'CandidacyNoteSet' | 'RewardPayment' | 'BudgetBalanceSet' | 'BudgetRefill' | 'BudgetRefillPlanned' | 'BudgetIncrementUpdated' | 'CouncilorRewardUpdated' | 'RequestFunded' | 'CouncilBudgetFunded' | 'CouncilorRemarked' | 'CandidateRemarked'; ++ readonly type: 'AnnouncingPeriodStarted' | 'NotEnoughCandidates' | 'VotingPeriodStarted' | 'NewCandidate' | 'NewCouncilElected' | 'NewCouncilNotElected' | 'CandidacyStakeRelease' | 'CandidacyWithdraw' | 'CandidacyNoteSet' | 'RewardPayment' | 'BudgetBalanceSet' | 'BudgetRefill' | 'BudgetRefillPlanned' | 'BudgetIncrementUpdated' | 'CouncilorRewardUpdated' | 'CouncilBudgetDecreased' | 'RequestFunded' | 'CouncilBudgetFunded' | 'CouncilorRemarked' | 'CandidateRemarked'; + } + + /** @name PalletReferendumRawEvent (70) */ +@@ -1746,7 +1748,9 @@ declare module '@polkadot/types/lookup' { + readonly asUpdateChannelPayouts: PalletContentUpdateChannelPayoutsParametersRecord; + readonly isSetPalletFozenStatus: boolean; + readonly asSetPalletFozenStatus: ITuple<[bool, PalletCommonFreezablePallet]>; +- readonly type: 'Signal' | 'RuntimeUpgrade' | 'FundingRequest' | 'SetMaxValidatorCount' | 'CreateWorkingGroupLeadOpening' | 'FillWorkingGroupLeadOpening' | 'UpdateWorkingGroupBudget' | 'DecreaseWorkingGroupLeadStake' | 'SlashWorkingGroupLead' | 'SetWorkingGroupLeadReward' | 'TerminateWorkingGroupLead' | 'AmendConstitution' | 'CancelWorkingGroupLeadOpening' | 'SetMembershipPrice' | 'SetCouncilBudgetIncrement' | 'SetCouncilorReward' | 'SetInitialInvitationBalance' | 'SetInitialInvitationCount' | 'SetMembershipLeadInvitationQuota' | 'SetReferralCut' | 'VetoProposal' | 'UpdateGlobalNftLimit' | 'UpdateChannelPayouts' | 'SetPalletFozenStatus'; ++ readonly isDecreaseCouncilBudget: boolean; ++ readonly asDecreaseCouncilBudget: u128; ++ readonly type: 'Signal' | 'RuntimeUpgrade' | 'FundingRequest' | 'SetMaxValidatorCount' | 'CreateWorkingGroupLeadOpening' | 'FillWorkingGroupLeadOpening' | 'UpdateWorkingGroupBudget' | 'DecreaseWorkingGroupLeadStake' | 'SlashWorkingGroupLead' | 'SetWorkingGroupLeadReward' | 'TerminateWorkingGroupLead' | 'AmendConstitution' | 'CancelWorkingGroupLeadOpening' | 'SetMembershipPrice' | 'SetCouncilBudgetIncrement' | 'SetCouncilorReward' | 'SetInitialInvitationBalance' | 'SetInitialInvitationCount' | 'SetMembershipLeadInvitationQuota' | 'SetReferralCut' | 'VetoProposal' | 'UpdateGlobalNftLimit' | 'UpdateChannelPayouts' | 'SetPalletFozenStatus' | 'DecreaseCouncilBudget'; + } + + /** @name PalletCommonFundingRequestParameters (214) */ +@@ -3053,6 +3057,10 @@ declare module '@polkadot/types/lookup' { + readonly asSetCouncilorReward: { + readonly councilorReward: u128; + } & Struct; ++ readonly isDecreaseCouncilBudget: boolean; ++ readonly asDecreaseCouncilBudget: { ++ readonly reductionAmount: u128; ++ } & Struct; + readonly isFundingRequest: boolean; + readonly asFundingRequest: { + readonly fundingRequests: Vec; +@@ -3073,7 +3081,7 @@ declare module '@polkadot/types/lookup' { + readonly candidateId: u64; + readonly msg: Bytes; + } & Struct; +- readonly type: 'AnnounceCandidacy' | 'ReleaseCandidacyStake' | 'WithdrawCandidacy' | 'SetCandidacyNote' | 'SetBudget' | 'PlanBudgetRefill' | 'SetBudgetIncrement' | 'SetCouncilorReward' | 'FundingRequest' | 'FundCouncilBudget' | 'CouncilorRemark' | 'CandidateRemark'; ++ readonly type: 'AnnounceCandidacy' | 'ReleaseCandidacyStake' | 'WithdrawCandidacy' | 'SetCandidacyNote' | 'SetBudget' | 'PlanBudgetRefill' | 'SetBudgetIncrement' | 'SetCouncilorReward' | 'DecreaseCouncilBudget' | 'FundingRequest' | 'FundCouncilBudget' | 'CouncilorRemark' | 'CandidateRemark'; + } + + /** @name PalletReferendumCall (380) */ +@@ -4717,7 +4725,8 @@ declare module '@polkadot/types/lookup' { + readonly isZeroTokensFunding: boolean; + readonly isCandidateDoesNotExist: boolean; + readonly isInsufficientBalanceForTransfer: boolean; +- readonly type: 'ArithmeticError' | 'BadOrigin' | 'CantCandidateNow' | 'CantReleaseStakeNow' | 'CandidacyStakeTooLow' | 'CantCandidateTwice' | 'ConflictingStake' | 'StakeStillNeeded' | 'NoStake' | 'InsufficientBalanceForStaking' | 'CantVoteForYourself' | 'MemberIdNotMatchAccount' | 'InvalidAccountToStakeReuse' | 'NotCandidatingNow' | 'CantWithdrawCandidacyNow' | 'NotCouncilor' | 'InsufficientFundsForFundingRequest' | 'ZeroBalanceFundRequest' | 'RepeatedFundRequestAccount' | 'EmptyFundingRequests' | 'InsufficientTokensForFunding' | 'ZeroTokensFunding' | 'CandidateDoesNotExist' | 'InsufficientBalanceForTransfer'; ++ readonly isReductionAmountTooLarge: boolean; ++ readonly type: 'ArithmeticError' | 'BadOrigin' | 'CantCandidateNow' | 'CantReleaseStakeNow' | 'CandidacyStakeTooLow' | 'CantCandidateTwice' | 'ConflictingStake' | 'StakeStillNeeded' | 'NoStake' | 'InsufficientBalanceForStaking' | 'CantVoteForYourself' | 'MemberIdNotMatchAccount' | 'InvalidAccountToStakeReuse' | 'NotCandidatingNow' | 'CantWithdrawCandidacyNow' | 'NotCouncilor' | 'InsufficientFundsForFundingRequest' | 'ZeroBalanceFundRequest' | 'RepeatedFundRequestAccount' | 'EmptyFundingRequests' | 'InsufficientTokensForFunding' | 'ZeroTokensFunding' | 'CandidateDoesNotExist' | 'InsufficientBalanceForTransfer' | 'ReductionAmountTooLarge'; + } + + /** @name PalletReferendumReferendumStage (525) */ +@@ -5586,7 +5595,8 @@ declare module '@polkadot/types/lookup' { + readonly isInvalidLeadApplicationId: boolean; + readonly isInvalidProposalId: boolean; + readonly isArithmeticError: boolean; +- readonly type: 'SignalProposalIsEmpty' | 'RuntimeProposalIsEmpty' | 'InvalidFundingRequestProposalBalance' | 'InvalidValidatorCount' | 'RequireRootOrigin' | 'InvalidCouncilElectionParameterCouncilSize' | 'InvalidCouncilElectionParameterCandidacyLimit' | 'InvalidCouncilElectionParameterMinVotingStake' | 'InvalidCouncilElectionParameterNewTermDuration' | 'InvalidCouncilElectionParameterMinCouncilStake' | 'InvalidCouncilElectionParameterRevealingPeriod' | 'InvalidCouncilElectionParameterVotingPeriod' | 'InvalidCouncilElectionParameterAnnouncingPeriod' | 'InvalidWorkingGroupBudgetCapacity' | 'InvalidSetLeadParameterCannotBeCouncilor' | 'SlashingStakeIsZero' | 'DecreasingStakeIsZero' | 'InsufficientFundsForBudgetUpdate' | 'InvalidFundingRequestProposalNumberOfAccount' | 'InvalidFundingRequestProposalRepeatedAccount' | 'InvalidChannelPayoutsProposalMinCashoutExceedsMaxCashout' | 'InvalidLeadWorkerId' | 'InvalidLeadOpeningId' | 'InvalidLeadApplicationId' | 'InvalidProposalId' | 'ArithmeticError'; ++ readonly isReductionAmountZero: boolean; ++ readonly type: 'SignalProposalIsEmpty' | 'RuntimeProposalIsEmpty' | 'InvalidFundingRequestProposalBalance' | 'InvalidValidatorCount' | 'RequireRootOrigin' | 'InvalidCouncilElectionParameterCouncilSize' | 'InvalidCouncilElectionParameterCandidacyLimit' | 'InvalidCouncilElectionParameterMinVotingStake' | 'InvalidCouncilElectionParameterNewTermDuration' | 'InvalidCouncilElectionParameterMinCouncilStake' | 'InvalidCouncilElectionParameterRevealingPeriod' | 'InvalidCouncilElectionParameterVotingPeriod' | 'InvalidCouncilElectionParameterAnnouncingPeriod' | 'InvalidWorkingGroupBudgetCapacity' | 'InvalidSetLeadParameterCannotBeCouncilor' | 'SlashingStakeIsZero' | 'DecreasingStakeIsZero' | 'InsufficientFundsForBudgetUpdate' | 'InvalidFundingRequestProposalNumberOfAccount' | 'InvalidFundingRequestProposalRepeatedAccount' | 'InvalidChannelPayoutsProposalMinCashoutExceedsMaxCashout' | 'InvalidLeadWorkerId' | 'InvalidLeadOpeningId' | 'InvalidLeadApplicationId' | 'InvalidProposalId' | 'ArithmeticError' | 'ReductionAmountZero'; + } + + /** @name PalletWorkingGroupOpening (615) */ diff --git a/package.json b/package.json index 7a1ef87d39..f128399d40 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@babel/parser": "~7.21.0", "@babel/traverse": "~7.21.0", "@babel/types": "~7.21.0", - "@joystream/types": "4.3.0", + "@joystream/types": "patch:@joystream/types@npm%3A4.3.0#./.yarn/patches/@joystream-types-npm-4.3.0-542438a0b6.patch", "@polkadot/api": "10.1.4", "@polkadot/api-contract": "10.1.4", "@polkadot/api-derive": "10.1.4", diff --git a/packages/server/src/common/queries/schema.graphql b/packages/server/src/common/queries/schema.graphql index e31bc5b9f6..81c8ddd920 100644 --- a/packages/server/src/common/queries/schema.graphql +++ b/packages/server/src/common/queries/schema.graphql @@ -87,6 +87,7 @@ enum EventTypeOptions { CommentPinnedEvent CommentReactedEvent CommentTextUpdatedEvent + CouncilBudgetDecreasedEvent CouncilBudgetFundedEvent CouncilorRewardUpdatedEvent EnglishAuctionSettledEvent @@ -2590,6 +2591,7 @@ union ProposalDetails = | UpdateChannelPayoutsProposalDetails | UpdatePalletFrozenStatusProposalDetails | UpdateGlobalNftLimitProposalDetails + | DecreaseCouncilBudgetProposalDetails union ProposalStatus = ProposalStatusDeciding @@ -2976,6 +2978,13 @@ type DataObjectTypeVideoThumbnail { video: Video } +type DecreaseCouncilBudgetProposalDetails { + """ + Proposed amount of token to burn + """ + amount: BigInt! +} + type DecreaseWorkingGroupLeadStakeProposalDetails { """ The lead that should be affected @@ -5261,6 +5270,17 @@ type CommentConnection { pageInfo: PageInfo! } +type CouncilBudgetDecreasedEventEdge { + node: CouncilBudgetDecreasedEvent! + cursor: String! +} + +type CouncilBudgetDecreasedEventConnection { + totalCount: Int! + edges: [CouncilBudgetDecreasedEventEdge!]! + pageInfo: PageInfo! +} + type CouncilBudgetFundedEventEdge { node: CouncilBudgetFundedEvent! cursor: String! @@ -22796,6 +22816,81 @@ input ChannelVisibilitySetByModeratorEventUpdateInput { rationale: String } +input CouncilBudgetDecreasedEventWhereInput { + id_eq: ID + id_in: [ID!] + createdAt_eq: DateTime + createdAt_lt: DateTime + createdAt_lte: DateTime + createdAt_gt: DateTime + createdAt_gte: DateTime + createdById_eq: ID + createdById_in: [ID!] + updatedAt_eq: DateTime + updatedAt_lt: DateTime + updatedAt_lte: DateTime + updatedAt_gt: DateTime + updatedAt_gte: DateTime + updatedById_eq: ID + updatedById_in: [ID!] + deletedAt_all: Boolean + deletedAt_eq: DateTime + deletedAt_lt: DateTime + deletedAt_lte: DateTime + deletedAt_gt: DateTime + deletedAt_gte: DateTime + deletedById_eq: ID + deletedById_in: [ID!] + inExtrinsic_eq: String + inExtrinsic_contains: String + inExtrinsic_startsWith: String + inExtrinsic_endsWith: String + inExtrinsic_in: [String!] + inBlock_eq: Int + inBlock_gt: Int + inBlock_gte: Int + inBlock_lt: Int + inBlock_lte: Int + inBlock_in: [Int!] + network_eq: Network + network_in: [Network!] + indexInBlock_eq: Int + indexInBlock_gt: Int + indexInBlock_gte: Int + indexInBlock_lt: Int + indexInBlock_lte: Int + indexInBlock_in: [Int!] + amount_eq: BigInt + amount_gt: BigInt + amount_gte: BigInt + amount_lt: BigInt + amount_lte: BigInt + amount_in: [BigInt!] + AND: [CouncilBudgetDecreasedEventWhereInput!] + OR: [CouncilBudgetDecreasedEventWhereInput!] + NOT: [CouncilBudgetDecreasedEventWhereInput!] +} + +input CouncilBudgetDecreasedEventWhereUniqueInput { + id: ID! +} + +input CouncilBudgetDecreasedEventCreateInput { + inExtrinsic: String + inBlock: Float! + network: Network! + indexInBlock: Float! + amount: String! +} + +input CouncilBudgetDecreasedEventUpdateInput { + inExtrinsic: String + inBlock: Float + network: Network + indexInBlock: Float + amount: String +} + input CouncilBudgetFundedEventWhereInput { id_eq: ID id_in: [ID!] @@ -29529,6 +29624,47 @@ type BudgetRefillPlannedEvent implements Event & BaseGraphQLObject { nextRefillInBlock: Int! } +type CouncilBudgetDecreasedEvent implements Event & BaseGraphQLObject { + id: ID! + createdAt: DateTime! + createdById: ID! + updatedAt: DateTime + updatedById: ID + deletedAt: DateTime + deletedById: ID + version: Int! + + """ + Hash of the extrinsic which caused the event to be emitted + """ + inExtrinsic: String + + """ + Blocknumber of the block in which the event was emitted. + """ + inBlock: Int! + + """ + Network the block was produced in + """ + network: Network! + + """ + Index of event in block from which it was emitted. + """ + indexInBlock: Int! + + """ + Filtering options for interface implementers + """ + type: EventTypeOptions + + """ + Funding amount. + """ + amount: BigInt! +} + type CouncilBudgetFundedEvent implements Event & BaseGraphQLObject { id: ID! createdAt: DateTime! @@ -31193,6 +31329,23 @@ type Query { where: CommentWhereInput orderBy: [CommentOrderByInput!] ): CommentConnection! + councilBudgetDecreasedEvents( + offset: Int + limit: Int = 50 + where: CouncilBudgetDecreasedEventWhereInput + orderBy: [CouncilBudgetDecreasedEventOrderByInput!] + ): [CouncilBudgetDecreasedEvent!]! + councilBudgetDecreasedEventByUniqueInput( + where: CouncilBudgetDecreasedEventWhereUniqueInput! + ): CouncilBudgetDecreasedEvent + councilBudgetDecreasedEventsConnection( + first: Int + after: String + last: Int + before: String + where: CouncilBudgetDecreasedEventWhereInput + orderBy: [CouncilBudgetDecreasedEventOrderByInput!] + ): CouncilBudgetDecreasedEventConnection! councilBudgetFundedEvents( offset: Int limit: Int = 50 @@ -34940,6 +35093,25 @@ enum CommentOrderByInput { isEdited_DESC } +enum CouncilBudgetDecreasedEventOrderByInput { + createdAt_ASC + createdAt_DESC + updatedAt_ASC + updatedAt_DESC + deletedAt_ASC + deletedAt_DESC + inExtrinsic_ASC + inExtrinsic_DESC + inBlock_ASC + inBlock_DESC + network_ASC + network_DESC + indexInBlock_ASC + indexInBlock_DESC + amount_ASC + amount_DESC +} + enum CouncilBudgetFundedEventOrderByInput { createdAt_ASC createdAt_DESC diff --git a/packages/ui/src/app/pages/Proposals/CurrentProposals.stories.tsx b/packages/ui/src/app/pages/Proposals/CurrentProposals.stories.tsx index 2655ce2ace..ebaf674866 100644 --- a/packages/ui/src/app/pages/Proposals/CurrentProposals.stories.tsx +++ b/packages/ui/src/app/pages/Proposals/CurrentProposals.stories.tsx @@ -1543,3 +1543,37 @@ export const SpecificParametersRuntimeUpgrade: Story = { }) }), } + +export const SpecificParametersDecreaseCouncilBudget: Story = { + parameters: { + councilBudget: joy(500), + }, + play: specificParametersTest('Decrease Council Budget', async ({ args, createProposal, modal, step }) => { + await createProposal(async () => { + const nextButton = getButtonByText(modal, 'Create proposal') + expect(nextButton).toBeDisabled() + + const amountField = await modal.findByLabelText('Decrease budget by') + + // Invalid price set to 0 + await userEvent.type(amountField, '0') + expect(await modal.findByText('Amount must be greater than zero')) + expect(nextButton).toBeDisabled() + + // Invalid price set to 0 + await userEvent.clear(amountField) + await userEvent.type(amountField, '600') + expect(await modal.findByText('The current council budget is 500JOY')) + expect(nextButton).toBeDisabled() + + // Valid + await userEvent.clear(amountField) + await userEvent.type(amountField, '8') + }) + + await step('Transaction parameters', () => { + const [, , specificParameters] = args.onCreateProposal.mock.calls.at(-1) + expect(specificParameters.toJSON()).toEqual({ decreaseCouncilBudget: 8_0000000000 }) + }) + }), +} diff --git a/packages/ui/src/app/pages/Proposals/ProposalPreview.stories.tsx b/packages/ui/src/app/pages/Proposals/ProposalPreview.stories.tsx index b94aa4b0df..65617ed382 100644 --- a/packages/ui/src/app/pages/Proposals/ProposalPreview.stories.tsx +++ b/packages/ui/src/app/pages/Proposals/ProposalPreview.stories.tsx @@ -218,12 +218,6 @@ export default { // ProposalPreview // ---------------------------------------------------------------------------- -export const AmendConstitution: Story = { - args: { type: 'AmendConstitutionProposalDetails', constitutionality: 2 }, - parameters: { - statuses: ['ProposalStatusDeciding', 'ProposalStatusDormant', 'ProposalStatusDeciding'] satisfies ProposalStatus[], - }, -} export const CancelWorkingGroupLeadOpening: Story = { args: { type: 'CancelWorkingGroupLeadOpeningProposalDetails' }, } @@ -302,9 +296,20 @@ export const UpdatePalletFrozenStatus: Story = { export const UpdateWorkingGroupBudget: Story = { args: { type: 'UpdateWorkingGroupBudgetProposalDetails' }, } +export const DecreaseCouncilBudget: Story = { + args: { type: 'DecreaseCouncilBudgetProposalDetails' }, +} + +// Disabled proposals export const Veto: Story = { args: { type: 'VetoProposalDetails' }, } +export const AmendConstitution: Story = { + args: { type: 'AmendConstitutionProposalDetails', constitutionality: 2 }, + parameters: { + statuses: ['ProposalStatusDeciding', 'ProposalStatusDormant', 'ProposalStatusDeciding'] satisfies ProposalStatus[], + }, +} // ---------------------------------------------------------------------------- // VoteForProposalModal diff --git a/packages/ui/src/common/api/queries/__generated__/baseTypes.generated.ts b/packages/ui/src/common/api/queries/__generated__/baseTypes.generated.ts index a2586e7b1c..fb083cc05f 100644 --- a/packages/ui/src/common/api/queries/__generated__/baseTypes.generated.ts +++ b/packages/ui/src/common/api/queries/__generated__/baseTypes.generated.ts @@ -9791,6 +9791,138 @@ export enum Continent { Sa = 'SA', } +export type CouncilBudgetDecreasedEvent = BaseGraphQlObject & + Event & { + __typename: 'CouncilBudgetDecreasedEvent' + /** Funding amount. */ + amount: Scalars['BigInt'] + createdAt: Scalars['DateTime'] + createdById: Scalars['ID'] + deletedAt?: Maybe + deletedById?: Maybe + id: Scalars['ID'] + /** Blocknumber of the block in which the event was emitted. */ + inBlock: Scalars['Int'] + /** Hash of the extrinsic which caused the event to be emitted */ + inExtrinsic?: Maybe + /** Index of event in block from which it was emitted. */ + indexInBlock: Scalars['Int'] + /** Network the block was produced in */ + network: Network + /** Filtering options for interface implementers */ + type?: Maybe + updatedAt?: Maybe + updatedById?: Maybe + version: Scalars['Int'] + } + +export type CouncilBudgetDecreasedEventConnection = { + __typename: 'CouncilBudgetDecreasedEventConnection' + edges: Array + pageInfo: PageInfo + totalCount: Scalars['Int'] +} + +export type CouncilBudgetDecreasedEventCreateInput = { + amount: Scalars['String'] + inBlock: Scalars['Float'] + inExtrinsic?: InputMaybe + indexInBlock: Scalars['Float'] + network: Network +} + +export type CouncilBudgetDecreasedEventEdge = { + __typename: 'CouncilBudgetDecreasedEventEdge' + cursor: Scalars['String'] + node: CouncilBudgetDecreasedEvent +} + +export enum CouncilBudgetDecreasedEventOrderByInput { + AmountAsc = 'amount_ASC', + AmountDesc = 'amount_DESC', + CreatedAtAsc = 'createdAt_ASC', + CreatedAtDesc = 'createdAt_DESC', + DeletedAtAsc = 'deletedAt_ASC', + DeletedAtDesc = 'deletedAt_DESC', + InBlockAsc = 'inBlock_ASC', + InBlockDesc = 'inBlock_DESC', + InExtrinsicAsc = 'inExtrinsic_ASC', + InExtrinsicDesc = 'inExtrinsic_DESC', + IndexInBlockAsc = 'indexInBlock_ASC', + IndexInBlockDesc = 'indexInBlock_DESC', + NetworkAsc = 'network_ASC', + NetworkDesc = 'network_DESC', + UpdatedAtAsc = 'updatedAt_ASC', + UpdatedAtDesc = 'updatedAt_DESC', +} + +export type CouncilBudgetDecreasedEventUpdateInput = { + amount?: InputMaybe + inBlock?: InputMaybe + inExtrinsic?: InputMaybe + indexInBlock?: InputMaybe + network?: InputMaybe +} + +export type CouncilBudgetDecreasedEventWhereInput = { + AND?: InputMaybe> + NOT?: InputMaybe> + OR?: InputMaybe> + amount_eq?: InputMaybe + amount_gt?: InputMaybe + amount_gte?: InputMaybe + amount_in?: InputMaybe> + amount_lt?: InputMaybe + amount_lte?: InputMaybe + createdAt_eq?: InputMaybe + createdAt_gt?: InputMaybe + createdAt_gte?: InputMaybe + createdAt_lt?: InputMaybe + createdAt_lte?: InputMaybe + createdById_eq?: InputMaybe + createdById_in?: InputMaybe> + deletedAt_all?: InputMaybe + deletedAt_eq?: InputMaybe + deletedAt_gt?: InputMaybe + deletedAt_gte?: InputMaybe + deletedAt_lt?: InputMaybe + deletedAt_lte?: InputMaybe + deletedById_eq?: InputMaybe + deletedById_in?: InputMaybe> + id_eq?: InputMaybe + id_in?: InputMaybe> + inBlock_eq?: InputMaybe + inBlock_gt?: InputMaybe + inBlock_gte?: InputMaybe + inBlock_in?: InputMaybe> + inBlock_lt?: InputMaybe + inBlock_lte?: InputMaybe + inExtrinsic_contains?: InputMaybe + inExtrinsic_endsWith?: InputMaybe + inExtrinsic_eq?: InputMaybe + inExtrinsic_in?: InputMaybe> + inExtrinsic_startsWith?: InputMaybe + indexInBlock_eq?: InputMaybe + indexInBlock_gt?: InputMaybe + indexInBlock_gte?: InputMaybe + indexInBlock_in?: InputMaybe> + indexInBlock_lt?: InputMaybe + indexInBlock_lte?: InputMaybe + network_eq?: InputMaybe + network_in?: InputMaybe> + updatedAt_eq?: InputMaybe + updatedAt_gt?: InputMaybe + updatedAt_gte?: InputMaybe + updatedAt_lt?: InputMaybe + updatedAt_lte?: InputMaybe + updatedById_eq?: InputMaybe + updatedById_in?: InputMaybe> +} + +export type CouncilBudgetDecreasedEventWhereUniqueInput = { + id: Scalars['ID'] +} + export type CouncilBudgetFundedEvent = BaseGraphQlObject & Event & { __typename: 'CouncilBudgetFundedEvent' @@ -10784,6 +10916,12 @@ export type DataObjectTypeVideoThumbnail = { video?: Maybe