Skip to content

Commit 12bde09

Browse files
authored
chore: merge from develop to preview (#4439)
2 parents 64e45fc + 251521b commit 12bde09

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

mobile/src/features/ReviewTx/common/hooks/useOnConfirm.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ const signTx = async (
448448
): Promise<{
449449
signedTx: (csl: WasmModuleProxy) => Transaction
450450
txId: string
451+
signedTxBytes: Uint8Array
451452
} | null> => {
452453
const result = await CardanoMobileWrapped.cslScope(async (csl) => {
453454
const signers = await getTransactionSigners(cbor, wallet, meta)
@@ -491,7 +492,11 @@ const signTx = async (
491492
return tx
492493
}
493494

494-
return {signedTx, txId: result.txId}
495+
return {
496+
signedTx,
497+
txId: result.txId,
498+
signedTxBytes: result.signedTxBytes, // Include bytes directly to avoid re-serialization
499+
}
495500
}
496501

497502
const submitTx = async (
@@ -512,11 +517,9 @@ const submitTx = async (
512517
return null
513518
}
514519

515-
// Get signed transaction bytes for submission
516-
const signedTxBytes = await CardanoMobileWrapped.cslScope(async (csl) => {
517-
const tx = signResult.signedTx(csl)
518-
return tx.toBytes()
519-
})
520+
// Use the bytes directly from signRawTransaction to avoid re-serialization
521+
// Re-serializing through Transaction.toBytes() might change the CBOR structure
522+
const signedTxBytes = signResult.signedTxBytes
520523

521524
// Submit the transaction (convert to base64 for API)
522525
const signedTxBase64 = Branded.asTransactionCborBase64(

mobile/src/features/ReviewTx/useCases/ReviewTxScreen/ReviewTxScreen.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import * as React from 'react'
66

77
import {useAnalyticsTracking} from '~/features/Analytics/hooks/useAnalyticsTracking'
88
import {AnalyticsEventEnum} from '~/features/Analytics/types/analytics-event-enum'
9-
import {useAuth} from '~/features/Auth/context/AuthProvider'
109
import {ReviewTxMemoProvider} from '~/features/ReviewTx/common/context/ReviewTxMemoContext'
1110
import {useFormattedMetadata} from '~/features/ReviewTx/common/hooks/useFormattedMetadata'
1211
import {useFormattedTx} from '~/features/ReviewTx/common/hooks/useFormattedTx'
@@ -18,8 +17,7 @@ import {
1817
TransactionBody,
1918
} from '~/features/ReviewTx/common/types'
2019
import {useUnsafeParams} from '~/kernel/navigation/hooks/useUnsafeParams'
21-
import {ReviewTxRoutes} from '~/kernel/navigation/types'
22-
import {ReviewContext} from '~/kernel/navigation/types'
20+
import {ReviewContext, ReviewTxRoutes} from '~/kernel/navigation/types'
2321
import {OperationContext} from '~/ui/ResultScreen/types'
2422

2523
import {ReviewTx} from './ReviewTx/ReviewTx'
@@ -90,7 +88,6 @@ const ReviewTxContent = ({
9088
trackEvent: ReturnType<typeof useAnalyticsTracking>['trackEvent']
9189
}) => {
9290
const {meta} = useSelectedWallet()
93-
const {isAuthDev} = useAuth()
9491
const {onConfirm} = useOnConfirm({
9592
cbor: params?.cbor,
9693
partial: params?.partial,
@@ -130,7 +127,7 @@ const ReviewTxContent = ({
130127
receiverCustomTitle={params?.receiverCustomTitle}
131128
createdBy={params?.createdBy}
132129
validationResult={validationResult}
133-
cbor={params?.cbor != null && isAuthDev ? params.cbor : null}
130+
cbor={params?.cbor ?? null}
134131
onConfirm={meta.isReadOnly ? undefined : handleOnConfirm}
135132
readOnly={meta.isReadOnly}
136133
isReviewFlow={true}

mobile/src/features/Transactions/common/getOperationTypeKey.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ export const getOperationTypeKey = (
182182
if (direction === 'RECEIVED') return 'swapResolved'
183183
}
184184

185+
/*
185186
// 4.5. Check for NIGHT redemption transactions
186187
// Pattern: Smart contract interaction where NIGHT tokens are being spent/redeemed
187188
// NIGHT token: policyId '0691b2fecca1ac4f53cb6dfb00b7013e561d1f34403b957cbb5af1fa', name '4e49474854'
@@ -229,7 +230,7 @@ export const getOperationTypeKey = (
229230
return 'nightRedemption'
230231
}
231232
}
232-
233+
*/
233234
// 5. Check for smart contracts
234235
if (
235236
!swapInfo.isSwap &&

mobile/src/features/Transactions/common/operationDisplay.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ export const getOperationDisplayText = (
319319
return strings.transactions.operation.swapResolved
320320
}
321321
}
322-
322+
/*
323323
// 4.5. Check for NIGHT redemption transactions
324324
// Pattern: Smart contract interaction where NIGHT tokens are being spent/redeemed
325325
// Redemption pattern: NIGHT tokens in inputs (being spent) + smart contract address present
@@ -353,7 +353,7 @@ export const getOperationDisplayText = (
353353
return strings.transactions.operation.nightRedemption
354354
}
355355
}
356-
356+
*/
357357
// 5. Check for smart contracts (only if no certificate matched, no mint/burn, and not a swap)
358358
if (
359359
!swapInfo.isSwap &&

0 commit comments

Comments
 (0)