Skip to content

Commit

Permalink
fix(transaction): update value conversion in prepareTransaction test
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsdls committed Feb 21, 2024
1 parent b9cc7a0 commit 05b4e8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/thirdweb/src/transaction/prepare-transaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { TEST_WALLET_A, TEST_WALLET_B } from "../../test/src/addresses.js";
import { estimateGas } from "./actions/estimate-gas.js";
import { prepareTransaction } from "./prepare-transaction.js";
import { ethereum } from "../chains/chain-definitions/ethereum.js";
import { parseEther } from "../utils/units.js";
import { toWei } from "../utils/units.js";

describe("prepareTransaction", () => {
test("should prepare a transaction", () => {
const preparedTx = prepareTransaction({
chain: ethereum,
client: TEST_CLIENT,
to: TEST_WALLET_B,
value: parseEther("0.1"),
value: toWei("0.1"),
});
expect(preparedTx.to).toBe(TEST_WALLET_B);
expect(preparedTx.value).toMatchInlineSnapshot(`100000000000000000n`);
Expand All @@ -25,7 +25,7 @@ describe("prepareTransaction", () => {
chain: ethereum,
client: TEST_CLIENT,
to: TEST_WALLET_B,
value: parseEther("0.1"),
value: toWei("0.1"),
});
const estimate = await estimateGas({
transaction: preparedTx,
Expand Down
4 changes: 2 additions & 2 deletions packages/thirdweb/src/transaction/prepare-transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ export type PreparedTransaction<
* @transaction
* @example
* ```ts
* import { prepareTransaction, parseEther } from "thirdweb";
* import { prepareTransaction, toWei } from "thirdweb";
* import { ethereum } from "thirdweb/chains";
* const transaction = prepareTransaction({
* to: "0x1234567890123456789012345678901234567890",
* chain: ethereum,
* client: thirdwebClient,
* value: parseEther("1.0"),
* value: toWei("1.0"),
* });
* ```
*/
Expand Down

0 comments on commit 05b4e8c

Please sign in to comment.