Skip to content

Commit d194566

Browse files
fix test
1 parent 3545b1a commit d194566

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

packages/thirdweb/src/pay/convert/cryptoToFiat.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { describe, expect, it, vi } from "vitest";
22
import { TEST_CLIENT } from "~test/test-clients.js";
3-
import { TEST_ACCOUNT_A } from "~test/test-wallets.js";
43
import { base } from "../../chains/chain-definitions/base.js";
54
import { ethereum } from "../../chains/chain-definitions/ethereum.js";
65
import { sepolia } from "../../chains/chain-definitions/sepolia.js";
7-
import { NATIVE_TOKEN_ADDRESS } from "../../constants/addresses.js";
6+
import {
7+
NATIVE_TOKEN_ADDRESS,
8+
ZERO_ADDRESS,
9+
} from "../../constants/addresses.js";
810
import { convertCryptoToFiat } from "./cryptoToFiat.js";
911

1012
describe.runIf(process.env.TW_SECRET_KEY)("Pay: crypto-to-fiat", () => {
@@ -49,7 +51,7 @@ describe.runIf(process.env.TW_SECRET_KEY)("Pay: crypto-to-fiat", () => {
4951
expect(data.result).toBe(0);
5052
});
5153

52-
it("should throw error for testnet chain (because testnets are not supported", async () => {
54+
it("should throw error for testnet chain (because testnets are not supported)", async () => {
5355
await expect(
5456
convertCryptoToFiat({
5557
chain: sepolia,
@@ -81,13 +83,13 @@ describe.runIf(process.env.TW_SECRET_KEY)("Pay: crypto-to-fiat", () => {
8183
await expect(
8284
convertCryptoToFiat({
8385
chain: base,
84-
fromTokenAddress: TEST_ACCOUNT_A.address,
86+
fromTokenAddress: ZERO_ADDRESS,
8587
fromAmount: 1,
8688
to: "USD",
8789
client: TEST_CLIENT,
8890
}),
8991
).rejects.toThrowError(
90-
`Error: ${TEST_ACCOUNT_A.address} on chainId: ${base.id} is not a valid contract address.`,
92+
`Error: ${ZERO_ADDRESS} on chainId: ${base.id} is not a valid contract address.`,
9193
);
9294
});
9395
it("should throw if response is not OK", async () => {

0 commit comments

Comments
 (0)