Skip to content

Commit

Permalink
test: ✅ update post runtime upgrade tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ignazio-bovo committed Apr 3, 2024
1 parent f2e8cb2 commit f3a9a2b
Showing 1 changed file with 1 addition and 52 deletions.
53 changes: 1 addition & 52 deletions tests/network-tests/src/misc/postRuntimeUpgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,59 +12,8 @@ export default async function assertValues({ api }: FlowProps): Promise<void> {
const version = await api.rpc.state.getRuntimeVersion()
assert.equal(version.specVersion.toNumber(), 2002)

debug('Check forum sub category limit')
const subCategoryLimit = api.consts.forum.maxDirectSubcategoriesInCategory.toNumber()
assert.equal(subCategoryLimit, 10)

debug('Check workers limit')
for (const group of ['storageWorkingGroup', 'distributionWorkingGroup']) {
const workerLimit = (api.consts[group].maxWorkerNumberLimit as u32).toNumber()
assert.equal(workerLimit, 50, `${group} invalid limit of workers`)
}

for (const group of [
'forumWorkingGroup',
'contentWorkingGroup',
'membershipWorkingGroup',
'appWorkingGroup',
'operationsWorkingGroupAlpha',
'operationsWorkingGroupBeta',
'operationsWorkingGroupGamma',
]) {
const workerLimit = (api.consts[group].maxWorkerNumberLimit as u32).toNumber()
assert.equal(workerLimit, 30, `${group} invalid limit of workers`)
}

const expectedPermissions = createType(
'BTreeMap<u8,BTreeSet<PalletContentPermissionsCuratorGroupIterableEnumsContentModerationAction>>',
new Map([
[
0,
[
{ 'HideVideo': null },
{ 'ChangeChannelFeatureStatus': { 'CreatorTokenIssuance': null } },
{ 'DeleteVideoAssets': true },
],
],
[
1,
[
{ 'HideChannel': null },
{ 'ChangeChannelFeatureStatus': { 'VideoUpdate': null } },
{ 'DeleteVideoAssets': false },
],
],
])
)

const lastCuratorGroup = (await api.query.content.nextCuratorGroupId()).subn(1)
const curatorGroup = await api.query.content.curatorGroupById(lastCuratorGroup)
assert(curatorGroup.active.eq(true))
// This would be cleaner but doesn't work correctly
// assert.deepEqual(curatorGroup.permissionsByLevel, expectedPermissions)
assert.equal(`${curatorGroup.permissionsByLevel}`, `${expectedPermissions}`)

// Damping factor after runtime should be 100% = default
debug('Council Damping factor initial value')
const dampingFactor = await api.query.council.eraPayoutDampingFactor()
assert(dampingFactor.eqn(100), 'Damping factor should be default = 100%')

Expand Down

0 comments on commit f3a9a2b

Please sign in to comment.