difftreelog
Merge pull request #993 from UniqueNetwork/fix/governance-with-batch
in: master
Fix/governance with batch
10 files changed
Cargo.tomldiffbeforeafterboth119pallet-state-trie-migration = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }119pallet-state-trie-migration = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }120pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }120pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }121pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }121pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }122pallet-utility = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }122pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }123pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }123pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }124pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }124pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }125pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }runtime/common/config/governance/technical_committee.rsdiffbeforeafterboth38 type RemoveOrigin = RootOrMoreThanHalfCouncil;38 type RemoveOrigin = RootOrMoreThanHalfCouncil;39 type SwapOrigin = RootOrMoreThanHalfCouncil;39 type SwapOrigin = RootOrMoreThanHalfCouncil;40 type ResetOrigin = EnsureRoot<AccountId>;40 type ResetOrigin = EnsureRoot<AccountId>;41 type PrimeOrigin = EnsureRoot<AccountId>;41 type PrimeOrigin = RootOrMoreThanHalfCouncil;42 type MembershipInitialized = TechnicalCommittee;42 type MembershipInitialized = TechnicalCommittee;43 type MembershipChanged = TechnicalCommittee;43 type MembershipChanged = TechnicalCommittee;44 type MaxMembers = TechnicalMaxMembers;44 type MaxMembers = TechnicalMaxMembers;runtime/common/config/substrate.rsdiffbeforeafterboth35};35};36use pallet_transaction_payment::{Multiplier, ConstFeeMultiplier};36use pallet_transaction_payment::{Multiplier, ConstFeeMultiplier};37use crate::{37use crate::{38 runtime_common::DealWithFees, Runtime, RuntimeEvent, RuntimeCall, RuntimeOrigin, PalletInfo,38 runtime_common::DealWithFees, Runtime, RuntimeEvent, RuntimeCall, RuntimeOrigin, OriginCaller,39 System, Balances, SS58Prefix, Version,39 PalletInfo, System, Balances, SS58Prefix, Version,40};40};41use up_common::{types::*, constants::*};41use up_common::{types::*, constants::*};249 type MaxAuthorities = MaxAuthorities;249 type MaxAuthorities = MaxAuthorities;250}250}251252impl pallet_utility::Config for Runtime {253 type RuntimeEvent = RuntimeEvent;254 type RuntimeCall = RuntimeCall;255 type PalletsOrigin = OriginCaller;256 type WeightInfo = pallet_utility::weights::SubstrateWeight<Self>;257}251258runtime/common/construct_runtime.rsdiffbeforeafterboth136136137 BalancesAdapter: pallet_balances_adapter = 155,137 BalancesAdapter: pallet_balances_adapter = 155,138139 Utility: pallet_utility = 156,138140139 #[cfg(feature = "pallet-test-utils")]141 #[cfg(feature = "pallet-test-utils")]140 TestUtils: pallet_test_utils = 255,142 TestUtils: pallet_test_utils = 255,runtime/opal/Cargo.tomldiffbeforeafterboth58 'pallet-refungible/runtime-benchmarks',58 'pallet-refungible/runtime-benchmarks',59 'pallet-structure/runtime-benchmarks',59 'pallet-structure/runtime-benchmarks',60 'pallet-timestamp/runtime-benchmarks',60 'pallet-timestamp/runtime-benchmarks',61 'pallet-utility/runtime-benchmarks',61 'pallet-unique-scheduler-v2/runtime-benchmarks',62 'pallet-unique-scheduler-v2/runtime-benchmarks',62 'pallet-unique/runtime-benchmarks',63 'pallet-unique/runtime-benchmarks',63 'pallet-xcm/runtime-benchmarks',64 'pallet-xcm/runtime-benchmarks',120 'pallet-structure/std',121 'pallet-structure/std',121 'pallet-sudo/std',122 'pallet-sudo/std',122 'pallet-timestamp/std',123 'pallet-timestamp/std',124 'pallet-utility/std',123 'pallet-transaction-payment-rpc-runtime-api/std',125 'pallet-transaction-payment-rpc-runtime-api/std',124 'pallet-transaction-payment/std',126 'pallet-transaction-payment/std',125 'pallet-treasury/std',127 'pallet-treasury/std',213 'pallet-sudo/try-runtime',215 'pallet-sudo/try-runtime',214 'pallet-test-utils?/try-runtime',216 'pallet-test-utils?/try-runtime',215 'pallet-timestamp/try-runtime',217 'pallet-timestamp/try-runtime',218 'pallet-utility/try-runtime',216 'pallet-transaction-payment/try-runtime',219 'pallet-transaction-payment/try-runtime',217 'pallet-treasury/try-runtime',220 'pallet-treasury/try-runtime',218 'pallet-unique-scheduler-v2/try-runtime',221 'pallet-unique-scheduler-v2/try-runtime',263pallet-state-trie-migration = { workspace = true }266pallet-state-trie-migration = { workspace = true }264pallet-sudo = { workspace = true }267pallet-sudo = { workspace = true }265pallet-timestamp = { workspace = true }268pallet-timestamp = { workspace = true }269pallet-utility = { workspace = true }266pallet-transaction-payment = { workspace = true }270pallet-transaction-payment = { workspace = true }267pallet-transaction-payment-rpc-runtime-api = { workspace = true }271pallet-transaction-payment-rpc-runtime-api = { workspace = true }268pallet-treasury = { workspace = true }272pallet-treasury = { workspace = true }runtime/quartz/Cargo.tomldiffbeforeafterboth55 'pallet-scheduler/runtime-benchmarks',55 'pallet-scheduler/runtime-benchmarks',56 'pallet-structure/runtime-benchmarks',56 'pallet-structure/runtime-benchmarks',57 'pallet-timestamp/runtime-benchmarks',57 'pallet-timestamp/runtime-benchmarks',58 'pallet-utility/runtime-benchmarks',58 'pallet-unique/runtime-benchmarks',59 'pallet-unique/runtime-benchmarks',59 'pallet-xcm/runtime-benchmarks',60 'pallet-xcm/runtime-benchmarks',60 'sp-runtime/runtime-benchmarks',61 'sp-runtime/runtime-benchmarks',120 'pallet-structure/std',121 'pallet-structure/std',121 'pallet-sudo/std',122 'pallet-sudo/std',122 'pallet-timestamp/std',123 'pallet-timestamp/std',124 'pallet-utility/std',123 'pallet-transaction-payment-rpc-runtime-api/std',125 'pallet-transaction-payment-rpc-runtime-api/std',124 'pallet-transaction-payment/std',126 'pallet-transaction-payment/std',125 'pallet-treasury/std',127 'pallet-treasury/std',203 'pallet-structure/try-runtime',205 'pallet-structure/try-runtime',204 'pallet-sudo/try-runtime',206 'pallet-sudo/try-runtime',205 'pallet-timestamp/try-runtime',207 'pallet-timestamp/try-runtime',208 'pallet-utility/try-runtime',206 'pallet-transaction-payment/try-runtime',209 'pallet-transaction-payment/try-runtime',207 'pallet-treasury/try-runtime',210 'pallet-treasury/try-runtime',208 'pallet-unique/try-runtime',211 'pallet-unique/try-runtime',252pallet-state-trie-migration = { workspace = true }255pallet-state-trie-migration = { workspace = true }253pallet-sudo = { workspace = true }256pallet-sudo = { workspace = true }254pallet-timestamp = { workspace = true }257pallet-timestamp = { workspace = true }258pallet-utility = { workspace = true }255pallet-transaction-payment = { workspace = true }259pallet-transaction-payment = { workspace = true }256pallet-transaction-payment-rpc-runtime-api = { workspace = true }260pallet-transaction-payment-rpc-runtime-api = { workspace = true }257pallet-treasury = { workspace = true }261pallet-treasury = { workspace = true }runtime/unique/Cargo.tomldiffbeforeafterboth52 'pallet-scheduler/runtime-benchmarks',52 'pallet-scheduler/runtime-benchmarks',53 'pallet-structure/runtime-benchmarks',53 'pallet-structure/runtime-benchmarks',54 'pallet-timestamp/runtime-benchmarks',54 'pallet-timestamp/runtime-benchmarks',55 'pallet-utility/runtime-benchmarks',55 'pallet-unique/runtime-benchmarks',56 'pallet-unique/runtime-benchmarks',56 'pallet-xcm/runtime-benchmarks',57 'pallet-xcm/runtime-benchmarks',57 'sp-runtime/runtime-benchmarks',58 'sp-runtime/runtime-benchmarks',118 'pallet-structure/std',119 'pallet-structure/std',119 'pallet-sudo/std',120 'pallet-sudo/std',120 'pallet-timestamp/std',121 'pallet-timestamp/std',122 'pallet-utility/std',121 'pallet-transaction-payment-rpc-runtime-api/std',123 'pallet-transaction-payment-rpc-runtime-api/std',122 'pallet-transaction-payment/std',124 'pallet-transaction-payment/std',123 'pallet-treasury/std',125 'pallet-treasury/std',205 'pallet-structure/try-runtime',207 'pallet-structure/try-runtime',206 'pallet-sudo/try-runtime',208 'pallet-sudo/try-runtime',207 'pallet-timestamp/try-runtime',209 'pallet-timestamp/try-runtime',210 'pallet-utility/try-runtime',208 'pallet-transaction-payment/try-runtime',211 'pallet-transaction-payment/try-runtime',209 'pallet-treasury/try-runtime',212 'pallet-treasury/try-runtime',210 'pallet-unique/try-runtime',213 'pallet-unique/try-runtime',255pallet-state-trie-migration = { workspace = true }258pallet-state-trie-migration = { workspace = true }256pallet-sudo = { workspace = true }259pallet-sudo = { workspace = true }257pallet-timestamp = { workspace = true }260pallet-timestamp = { workspace = true }261pallet-utility = { workspace = true }258pallet-transaction-payment = { workspace = true }262pallet-transaction-payment = { workspace = true }259pallet-transaction-payment-rpc-runtime-api = { workspace = true }263pallet-transaction-payment-rpc-runtime-api = { workspace = true }260pallet-treasury = { workspace = true }264pallet-treasury = { workspace = true }tests/src/governance/init.test.tsdiffbeforeafterbothno changes
tests/src/pallet-presence.test.tsdiffbeforeafterboth27 'statetriemigration',27 'statetriemigration',28 'structure',28 'structure',29 'system',29 'system',30 'utility',30 'vesting',31 'vesting',31 'parachainsystem',32 'parachainsystem',32 'parachaininfo',33 'parachaininfo',tests/src/util/playgrounds/unique.tsdiffbeforeafterboth3255 return this.helper.executeExtrinsic(signer, `api.tx.${this.collective}.promoteMember`, [member]);3255 return this.helper.executeExtrinsic(signer, `api.tx.${this.collective}.promoteMember`, [member]);3256 }3256 }325732573258 promoteCall(newMember: string) {3258 promoteCall(member: string) {3259 return this.helper.constructApiCall(`api.tx.${this.collective}.promoteMember`, [newMember]);3259 return this.helper.constructApiCall(`api.tx.${this.collective}.promoteMember`, [member]);3260 }3260 }326132613262 demote(signer: TSigner, member: string) {3262 demote(signer: TSigner, member: string) {3276 .map((key) => key.args[0].toString());3276 .map((key) => key.args[0].toString());3277 }3277 }32783279 async getMemberRank(member: string) {3280 return (await this.helper.callRpc('api.query.fellowshipCollective.members', [member])).toJSON().rank;3281 }3278}3282}327932833280class ReferendaGroup extends HelperGroup<UniqueHelper> {3284class ReferendaGroup extends HelperGroup<UniqueHelper> {3381 return this.helper.constructApiCall('api.tx.democracy.externalProposeDefault', [{Inline: proposalCall.method.toHex()}]);3385 return this.helper.constructApiCall('api.tx.democracy.externalProposeDefault', [{Inline: proposalCall.method.toHex()}]);3382 }3386 }33873388 externalProposeDefaultWithPreimageCall(preimage: string) {3389 return this.helper.constructApiCall('api.tx.democracy.externalProposeDefault', [{Legacy: preimage}]);3390 }338333913384 // ... and blacklist external proposal hash.3392 // ... and blacklist external proposal hash.3385 vetoExternal(signer: TSigner, proposalHash: string) {3393 vetoExternal(signer: TSigner, proposalHash: string) {3733 }3741 }3734}3742}37433744class UtilityGroup<T extends ChainHelperBase> extends HelperGroup<T> {3745 async batch(signer: TSigner, txs: any[]) {3746 return await this.helper.executeExtrinsic(signer, 'api.tx.utility.batch', [txs]);3747 }37483749 async batchAll(signer: TSigner, txs: any[]) {3750 return await this.helper.executeExtrinsic(signer, 'api.tx.utility.batchAll', [txs]);3751 }37523753 batchAllCall(txs: any[]) {3754 return this.helper.constructApiCall('api.tx.utility.batchAll', [txs]);3755 }3756}373537573736class AcalaAssetRegistryGroup extends HelperGroup<AcalaHelper> {3758class AcalaAssetRegistryGroup extends HelperGroup<AcalaHelper> {3737 async registerForeignAsset(signer: TSigner, destination: any, metadata: AcalaAssetMetadata) {3759 async registerForeignAsset(signer: TSigner, destination: any, metadata: AcalaAssetMetadata) {3835 xcm: XcmGroup<UniqueHelper>;3857 xcm: XcmGroup<UniqueHelper>;3836 xTokens: XTokensGroup<UniqueHelper>;3858 xTokens: XTokensGroup<UniqueHelper>;3837 tokens: TokensGroup<UniqueHelper>;3859 tokens: TokensGroup<UniqueHelper>;3860 utility: UtilityGroup<UniqueHelper>;383838613839 constructor(logger?: ILogger, options: { [key: string]: any } = {}) {3862 constructor(logger?: ILogger, options: { [key: string]: any } = {}) {3840 super(logger, options.helperBase ?? UniqueHelper);3863 super(logger, options.helperBase ?? UniqueHelper);3865 this.xcm = new XcmGroup(this, 'polkadotXcm');3888 this.xcm = new XcmGroup(this, 'polkadotXcm');3866 this.xTokens = new XTokensGroup(this);3889 this.xTokens = new XTokensGroup(this);3867 this.tokens = new TokensGroup(this);3890 this.tokens = new TokensGroup(this);3891 this.utility = new UtilityGroup(this);3868 }3892 }386938933870 getSudo<T extends UniqueHelper>() {3894 getSudo<T extends UniqueHelper>() {