Skip to content

Commit a02f3bb

Browse files
ui fixes, re-enable tests, stringify error
1 parent baec17f commit a02f3bb

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/tx/[id]/transaction-details-ui.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { format, formatDistanceToNowStrict } from "date-fns";
44
import { ExternalLinkIcon, InfoIcon } from "lucide-react";
55
import Link from "next/link";
6-
import { type ThirdwebClient, toEther } from "thirdweb";
6+
import { hexToNumber, isHex, type ThirdwebClient, toEther } from "thirdweb";
77
import type { Project } from "@/api/projects";
88
import { WalletAddress } from "@/components/blocks/wallet-address";
99
import { Badge } from "@/components/ui/badge";
@@ -68,7 +68,7 @@ export function TransactionDetailsUI({
6868
// Gas information
6969
const gasUsed =
7070
executionResult && "actualGasUsed" in executionResult
71-
? `${executionResult.actualGasUsed}`
71+
? `${isHex(executionResult.actualGasUsed) ? hexToNumber(executionResult.actualGasUsed) : executionResult.actualGasUsed}`
7272
: "N/A";
7373

7474
const gasCost =
@@ -339,7 +339,9 @@ export function TransactionDetailsUI({
339339
Block Number
340340
</div>
341341
<div className="text-sm md:w-2/3">
342-
{transaction.confirmedAtBlockNumber}
342+
{isHex(transaction.confirmedAtBlockNumber)
343+
? hexToNumber(transaction.confirmedAtBlockNumber)
344+
: transaction.confirmedAtBlockNumber}
343345
</div>
344346
</div>
345347
)}

packages/thirdweb/src/engine/server-wallet.test.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { sepolia } from "../chains/chain-definitions/sepolia.js";
99
import { getContract } from "../contract/contract.js";
1010
import { setContractURI } from "../extensions/common/__generated__/IContractMetadata/write/setContractURI.js";
1111
import { mintTo } from "../extensions/erc20/write/mintTo.js";
12+
import { setApprovalForAll } from "../extensions/erc1155/__generated__/IERC1155/write/setApprovalForAll.js";
1213
import { claimTo } from "../extensions/erc1155/drops/write/claimTo.js";
1314
import { getAllActiveSigners } from "../extensions/erc4337/__generated__/IAccountPermissions/read/getAllActiveSigners.js";
1415
import { sendTransaction } from "../transaction/actions/send-transaction.js";
@@ -44,13 +45,13 @@ describe.runIf(
4445
});
4546
serverWallet = Engine.serverWallet({
4647
address: process.env.ENGINE_CLOUD_WALLET_ADDRESS as string,
47-
chain: arbitrumSepolia,
48+
chain: sepolia,
4849
client: TEST_CLIENT,
4950
vaultAccessToken: process.env.VAULT_TOKEN as string,
5051
});
5152
});
5253

53-
it.skip("should create a server wallet", async () => {
54+
it("should create a server wallet", async () => {
5455
const serverWallet = await Engine.createServerWallet({
5556
client: TEST_CLIENT,
5657
label: "My Server Wallet",
@@ -155,14 +156,14 @@ describe.runIf(
155156

156157
it("should send a extension tx", async () => {
157158
const tokenContract = getContract({
158-
address: "0x87C52295891f208459F334975a3beE198fE75244",
159+
address: "0x638263e3eAa3917a53630e61B1fBa685308024fa",
159160
chain: baseSepolia,
160161
client: TEST_CLIENT,
161162
});
162-
const claimTx = mintTo({
163-
amount: "0.001",
163+
const claimTx = setApprovalForAll({
164+
approved: true,
164165
contract: tokenContract,
165-
to: serverWallet.address,
166+
operator: "0x4b8ceC1Eb227950F0bfd034449B2781e689242A1",
166167
});
167168
const tx = await sendTransaction({
168169
account: serverWallet,
@@ -173,19 +174,21 @@ describe.runIf(
173174

174175
it("should enqueue a batch of txs", async () => {
175176
const tokenContract = getContract({
176-
address: "0x87C52295891f208459F334975a3beE198fE75244",
177+
address: "0x638263e3eAa3917a53630e61B1fBa685308024fa",
177178
chain: baseSepolia,
178179
client: TEST_CLIENT,
179180
});
180-
const claimTx1 = mintTo({
181-
amount: "0.001",
181+
const claimTx1 = claimTo({
182182
contract: tokenContract,
183+
quantity: 1n,
183184
to: serverWallet.address,
185+
tokenId: 2n,
184186
});
185-
const claimTx2 = mintTo({
186-
amount: "0.002",
187+
const claimTx2 = claimTo({
187188
contract: tokenContract,
189+
quantity: 1n,
188190
to: serverWallet.address,
191+
tokenId: 2n,
189192
});
190193
const tx = await serverWallet.enqueueBatchTransaction({
191194
transactions: [claimTx1, claimTx2],

packages/thirdweb/src/engine/wait-for-tx-hash.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export async function waitForTransactionHash(args: {
3838
switch (status) {
3939
case "FAILED": {
4040
throw new Error(
41-
`Transaction failed: ${executionResult.error || "Unknown error"}`,
41+
`Transaction failed: ${stringify(executionResult.error) || "Unknown error"}`,
4242
);
4343
}
4444
case "CONFIRMED": {

0 commit comments

Comments
 (0)