We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f983ef4 commit ba517ebCopy full SHA for ba517eb
1 file changed
packages/apps/reputation-oracle/server/src/modules/user/fixtures/sitekey.ts
@@ -1,16 +1,28 @@
1
import { faker } from '@faker-js/faker';
2
3
+import { generateEthWallet } from '../../../../test/fixtures/web3';
4
+
5
import { SiteKeyEntity, SiteKeyType } from '../site-key.entity';
6
7
export function generateSiteKeyEntity(
8
userId: number,
9
type: SiteKeyType,
10
): SiteKeyEntity {
11
+ let siteKey: string;
12
+ switch (type) {
13
+ case SiteKeyType.HCAPTCHA:
14
+ siteKey = faker.string.uuid();
15
+ break;
16
+ case SiteKeyType.REGISTRATION:
17
+ siteKey = generateEthWallet().address;
18
19
+ }
20
21
return {
22
id: faker.number.int(),
23
userId,
24
type,
- siteKey: faker.string.uuid(),
25
+ siteKey,
26
createdAt: faker.date.recent(),
27
updatedAt: new Date(),
28
};
0 commit comments