mocks.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { bool, Option, Text, u32, u64, Vec } from '@polkadot/types';
  2. import AccountId from '@polkadot/types/primitive/Generic/AccountId';
  3. import { IMembership, EntryMethod } from '@joystream/types/members';
  4. import {
  5. AcceptingApplications,
  6. ActiveOpeningStage,
  7. OpeningStage,
  8. ActiveOpeningStageVariant,
  9. ApplicationId
  10. } from '@joystream/types/hiring';
  11. export function mockProfile (name: string, avatar_uri = ''): IMembership {
  12. return {
  13. handle: new Text(name),
  14. avatar_uri: new Text(avatar_uri),
  15. about: new Text(''),
  16. registered_at_block: new u32(0),
  17. registered_at_time: new u64(0),
  18. entry: new EntryMethod(),
  19. suspended: new bool(false),
  20. subscription: new Option(u64),
  21. root_account: new AccountId('5HZ6GtaeyxagLynPryM7ZnmLzoWFePKuDrkb4AT8rT4pU1fp'),
  22. controller_account: new AccountId('5HZ6GtaeyxagLynPryM7ZnmLzoWFePKuDrkb4AT8rT4pU1fp')
  23. };
  24. }
  25. export const mockStage = new OpeningStage({
  26. Active: new ActiveOpeningStageVariant({
  27. applications_added: new (Vec.with(ApplicationId))([]),
  28. active_application_count: new u32(0),
  29. unstaking_application_count: new u32(0),
  30. deactivated_application_count: new u32(0),
  31. stage: new ActiveOpeningStage({
  32. AcceptingApplications: new AcceptingApplications({
  33. started_accepting_applicants_at_block: new u32(100)
  34. })
  35. })
  36. })
  37. });