Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljscript committed Oct 15, 2024
1 parent bf06c40 commit 1bef9d6
Show file tree
Hide file tree
Showing 5 changed files with 171 additions and 180 deletions.
4 changes: 2 additions & 2 deletions apps/wallet-mobile/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ PODS:
- react-native-config/App (= 1.5.1)
- react-native-config/App (1.5.1):
- React-Core
- react-native-haskell-shelley (6.1.0-beta.1):
- react-native-haskell-shelley (7.0.0):
- React
- react-native-message_signing-library (1.0.4):
- React
Expand Down Expand Up @@ -882,7 +882,7 @@ SPEC CHECKSUMS:
react-native-background-timer: 17ea5e06803401a379ebf1f20505b793ac44d0fe
react-native-ble-plx: f10240444452dfb2d2a13a0e4f58d7783e92d76e
react-native-config: 86038147314e2e6d10ea9972022aa171e6b1d4d8
react-native-haskell-shelley: f3eaa102ff7b60063a4aff8bd36d23cb4de49c2e
react-native-haskell-shelley: bd200a42ef39f150d5505ae5bc1557ad465c6fd5
react-native-message_signing-library: 040317fed382be05d79e2ecbe5852d1a20ce68df
react-native-mmkv: e97c0c79403fb94577e5d902ab1ebd42b0715b43
react-native-pager-view: 0ccb8bf60e2ebd38b1f3669fa3650ecce81db2df
Expand Down
11 changes: 3 additions & 8 deletions apps/wallet-mobile/src/features/ReviewTx/common/types.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import {
TransactionBodyJSON,
TransactionInputsJSON,
TransactionOutputsJSON,
} from '@emurgo/cardano-serialization-lib-nodejs'
import {Balance, Portfolio} from '@yoroi/types'

export type TransactionBody = TransactionBodyJSON
export type TransactionInputs = TransactionInputsJSON
export type TransactionOutputs = TransactionOutputsJSON
export type TransactionBody = any

Check warning on line 3 in apps/wallet-mobile/src/features/ReviewTx/common/types.ts

View workflow job for this annotation

GitHub Actions / check

Unexpected any. Specify a different type
export type TransactionInputs = any

Check warning on line 4 in apps/wallet-mobile/src/features/ReviewTx/common/types.ts

View workflow job for this annotation

GitHub Actions / check

Unexpected any. Specify a different type
export type TransactionOutputs = any

Check warning on line 5 in apps/wallet-mobile/src/features/ReviewTx/common/types.ts

View workflow job for this annotation

GitHub Actions / check

Unexpected any. Specify a different type

export type FormattedInput = {
assets: Array<{
Expand Down
8 changes: 2 additions & 6 deletions apps/wallet-mobile/src/yoroi-wallets/cardano/cip30/cip30.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as CSL from '@emurgo/cross-csl-core'
import {TransactionWitnessSet, WasmModuleProxy} from '@emurgo/cross-csl-core'
import {init} from '@emurgo/cross-msl-mobile'
import {RemoteUnspentOutput, signRawTransaction, UtxoAsset} from '@emurgo/yoroi-lib'
import {hashTransaction, RemoteUnspentOutput, signRawTransaction, UtxoAsset} from '@emurgo/yoroi-lib'
import {normalizeToAddress} from '@emurgo/yoroi-lib/dist/internals/utils/addresses'
import {parseTokenList} from '@emurgo/yoroi-lib/dist/internals/utils/assets'
import {Balance, Wallet} from '@yoroi/types'
Expand Down Expand Up @@ -204,11 +204,7 @@ class CIP30Extension {
const txBody = await tx.body()
const signedTx = await csl.Transaction.new(txBody, witnesses, undefined)

const txId = await signedTx
.body()
.then((txBody) => csl.hashTransaction(txBody))
.then((hash) => hash.toBytes())
.then((bytes) => Buffer.from(bytes).toString('hex'))
const txId = (await hashTransaction(csl, signedTx)).toHex()

const signedTxBytes = await signedTx.toBytes()
await this.wallet.submitTransaction(Buffer.from(signedTxBytes).toString('base64'))
Expand Down
Loading

0 comments on commit 1bef9d6

Please sign in to comment.