Skip to content

Implement E2E tests for the Fellowship salary pallet #642

Description

@rockbmb

Context

The Polkadot Technical Fellowship pays its members a monthly salary via pallet-salary (index 64 on Collectives, parachain 1001). The payout is cross-chain: the salary pallet dispatches an XCM message via PayOverXcm to Asset Hub Polkadot, which transfers the salary asset from the pallet's sovereign account to the beneficiary.

PET currently has zero test coverage for the salary pallet.

Salary pallet lifecycle

init -> induct -> [each cycle] bump -> register -> payout -> check_payment
                  |                                |
                  |  RegistrationPeriod (15 days)   |  PayoutPeriod (15 days)
                  +--------------------------------+

Key things to test:

  • Induction: a ranked collective member joins the payroll
  • Registration: member locks in their salary amount (read from fellowshipCore.params()) within the registration window
  • Payout: member claims salary; the pallet dispatches XCM to Asset Hub
  • Cross-chain delivery: Asset Hub processes the XCM and transfers the asset to the beneficiary
  • Status bookkeeping: fellowshipSalary.status correctly tracks cycle index, budget, registration totals, and paid totals across transitions

Test structure

collectivesPolkadot.salary.e2e.test.ts

"Polkadot Collectives Salary"
+-- "salary lifecycle (raw)"
|   +-- full induct -> register -> payout cycle, no helpers, every step visible
+-- "salary status storage"
|   +-- verify Status storage invariants across cycle transitions
+-- "cross-chain payment"
    +-- salary payout delivers USDT to beneficiary on AssetHub (via payoutOther)

Test approach:

  • Real extrinsics for the subject under test; prerequisites seeded via setStorage
  • setStorage for time fast-forward (manipulating cycleStart to skip 108k+ blocks)
  • Salary params read from chain via fellowshipCore.params() and api.consts.fellowshipSalary.*
  • Shared module in packages/shared/src/salary.ts

Validated facts (from runtime source)

  • Sovereign account: 13w7NdvSR1Af8xsQTArDtZmVvjE8XhWNdL4yed3iFHrUNCnS -- validated by asset-hub-polkadot xcm_config.rs unit test
  • Pallet indices: FellowshipCollective=60, FellowshipCore=63, FellowshipSalary=64
  • RegistrationPeriod = PayoutPeriod = 15 x DAYS (DAYS=7200 blocks at 12s block time)
  • Budget = 250,000 x USDT_UNITS

Metadata

Metadata

Assignees

Labels

e2e testsRelated to end-to-end testsenhancementNew feature or request

Fields

No fields configured for Feature.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions