Skip to content

Commit 33ddf56

Browse files
authored
remove secretHash from rotate key response (#6401)
1 parent f9fa5df commit 33ddf56

File tree

3 files changed

+50
-49
lines changed

3 files changed

+50
-49
lines changed

apps/dashboard/src/@3rdweb-sdk/react/hooks/useApi.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@ export type RotateSecretKeyAPIReturnType = {
371371
data: {
372372
secret: string;
373373
secretMasked: string;
374-
secretHash: string;
375374
};
376375
};
377376

apps/dashboard/src/app/team/[team_slug]/[project_slug]/settings/ProjectGeneralSettingsPage.stories.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ function Story(props: {
7676
await new Promise((resolve) => setTimeout(resolve, 1000));
7777
return {
7878
data: {
79-
secret: new Array(86).fill("x").join(""),
80-
secretHash: new Array(64).fill("x").join(""),
81-
secretMasked: "123...4567",
79+
secret: `sk_${new Array(86).fill("x").join("")}`,
80+
secretMasked: "sk_123...4567",
8281
},
8382
};
8483
}}

packages/thirdweb/src/utils/bytecode/resolveImplementation.test.ts

Lines changed: 48 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -20,54 +20,57 @@ import { getContract } from "../../contract/contract.js";
2020
import { deployContract } from "../../contract/deployment/deploy-with-abi.js";
2121
import { resolveImplementation } from "./resolveImplementation.js";
2222

23-
describe("Resolve implementation", async () => {
24-
it("should extract implementation address for minimal proxy contract", async () => {
25-
const resolved = resolveImplementation(NFT_DROP_CONTRACT);
26-
expect((await resolved).address).to.equal(NFT_DROP_IMPLEMENTATION);
27-
});
28-
29-
it("should extract implementation address for matic proxy contract", async () => {
30-
const resolved = resolveImplementation(POLYGON_USDT_PROXY_CONTRACT);
31-
expect((await resolved).address).to.equal(
32-
POLYGON_USDT_IMPLEMENTATION.toLowerCase(),
33-
);
34-
});
35-
36-
it("should extract implementation address for base USDC proxy contract", async () => {
37-
const resolved = resolveImplementation(BASE_USDC_PROXY_CONTRACT);
38-
expect((await resolved).address).to.equal(
39-
BASE_USDC_IMPLEMENTATION.toLowerCase(),
40-
);
41-
});
42-
43-
it("should extract implementation address for ERC1967 proxy contract", async () => {
44-
const implementationAddress = await deployContract({
45-
client: TEST_CLIENT,
46-
chain: ANVIL_CHAIN,
47-
account: TEST_ACCOUNT_A,
48-
bytecode: DUMMY_BYTECODE,
49-
abi: [],
23+
describe.runIf(process.env.TW_SECRET_KEY)(
24+
"Resolve implementation",
25+
async () => {
26+
it("should extract implementation address for minimal proxy contract", async () => {
27+
const resolved = resolveImplementation(NFT_DROP_CONTRACT);
28+
expect((await resolved).address).to.equal(NFT_DROP_IMPLEMENTATION);
5029
});
5130

52-
const proxyAddress = await deployContract({
53-
client: TEST_CLIENT,
54-
chain: ANVIL_CHAIN,
55-
account: TEST_ACCOUNT_A,
56-
bytecode: ERC1967_PROXY_BYTECODE,
57-
abi: ERC1967_PROXY_CONSTRUCTOR_ABI as Abi,
58-
constructorParams: {
59-
logic: implementationAddress,
60-
data: "0x",
61-
},
31+
it("should extract implementation address for matic proxy contract", async () => {
32+
const resolved = resolveImplementation(POLYGON_USDT_PROXY_CONTRACT);
33+
expect((await resolved).address).to.equal(
34+
POLYGON_USDT_IMPLEMENTATION.toLowerCase(),
35+
);
6236
});
6337

64-
const proxy = getContract({
65-
chain: ANVIL_CHAIN,
66-
address: proxyAddress,
67-
client: TEST_CLIENT,
38+
it("should extract implementation address for base USDC proxy contract", async () => {
39+
const resolved = resolveImplementation(BASE_USDC_PROXY_CONTRACT);
40+
expect((await resolved).address).to.equal(
41+
BASE_USDC_IMPLEMENTATION.toLowerCase(),
42+
);
6843
});
6944

70-
const resolved = await resolveImplementation(proxy);
71-
expect(resolved.address).to.equal(implementationAddress);
72-
});
73-
});
45+
it("should extract implementation address for ERC1967 proxy contract", async () => {
46+
const implementationAddress = await deployContract({
47+
client: TEST_CLIENT,
48+
chain: ANVIL_CHAIN,
49+
account: TEST_ACCOUNT_A,
50+
bytecode: DUMMY_BYTECODE,
51+
abi: [],
52+
});
53+
54+
const proxyAddress = await deployContract({
55+
client: TEST_CLIENT,
56+
chain: ANVIL_CHAIN,
57+
account: TEST_ACCOUNT_A,
58+
bytecode: ERC1967_PROXY_BYTECODE,
59+
abi: ERC1967_PROXY_CONSTRUCTOR_ABI as Abi,
60+
constructorParams: {
61+
logic: implementationAddress,
62+
data: "0x",
63+
},
64+
});
65+
66+
const proxy = getContract({
67+
chain: ANVIL_CHAIN,
68+
address: proxyAddress,
69+
client: TEST_CLIENT,
70+
});
71+
72+
const resolved = await resolveImplementation(proxy);
73+
expect(resolved.address).to.equal(implementationAddress);
74+
});
75+
},
76+
);

0 commit comments

Comments
 (0)