Skip to content

Commit 8ebc3b9

Browse files
committed
chore: add given name on registered dRep wallet json
1 parent d098b68 commit 8ebc3b9

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

tests/govtool-frontend/playwright/lib/helpers/metadata.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,9 @@ async function calculateMetadataHash() {
5656

5757
export async function uploadMetadataAndGetJsonHash() {
5858
const { hexDigest: dataHash, jsonData } = await calculateMetadataHash();
59-
const url = await metadataBucketService.uploadMetadata(
60-
faker.person.firstName(),
61-
jsonData
62-
);
63-
return { dataHash, url };
59+
const givenName = faker.person.firstName();
60+
const url = await metadataBucketService.uploadMetadata(givenName, jsonData);
61+
return { dataHash, url, givenName };
6462
}
6563

6664
export async function uploadScriptAndGenerateUrl(payload: Object) {

tests/govtool-frontend/playwright/lib/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { CardanoTestWalletJson } from "@cardanoapi/cardano-test-wallet/types";
33
export type StaticWallet = CardanoTestWalletJson & {
44
dRepId: string;
55
address: string;
6+
givenName?: string;
67
};
78

89
export type KuberValue = {

tests/govtool-frontend/playwright/tests/dRep.setup.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { test as setup } from "@fixtures/walletExtension";
1111
import kuberService from "@services/kuberService";
1212
import walletManager from "lib/walletManager";
1313
import { functionWaitedAssert } from "@helpers/waitedLoop";
14+
import { StaticWallet } from "@types";
1415

1516
const REGISTER_DREP_WALLETS_COUNT = 6;
1617
const DREP_WALLETS_COUNT = 12;
@@ -64,7 +65,7 @@ setup("Register DRep of static wallets", async () => {
6465
setup("Setup temporary DRep wallets", async () => {
6566
setup.setTimeout(3 * environments.txTimeOut);
6667

67-
const dRepWallets = await generateWallets(DREP_WALLETS_COUNT);
68+
const dRepWallets: StaticWallet[] = await generateWallets(DREP_WALLETS_COUNT);
6869
const registerDRepWallets = await generateWallets(
6970
REGISTER_DREP_WALLETS_COUNT
7071
);
@@ -78,7 +79,16 @@ setup("Setup temporary DRep wallets", async () => {
7879

7980
// Submit metadata to obtain a URL and generate hash value.
8081
const metadataPromises = dRepWallets.map(async (dRepWallet) => {
81-
return { ...(await uploadMetadataAndGetJsonHash()), wallet: dRepWallet };
82+
const metadataResponse = await uploadMetadataAndGetJsonHash();
83+
const index = dRepWallets.indexOf(dRepWallet);
84+
dRepWallets[index] = {
85+
...dRepWallet,
86+
givenName: metadataResponse.givenName,
87+
};
88+
return {
89+
...metadataResponse,
90+
wallet: dRepWallet,
91+
};
8292
});
8393

8494
const metadatasAndDRepWallets = await Promise.all(metadataPromises);

0 commit comments

Comments
 (0)