Skip to content

Commit d50175f

Browse files
committed
fix: broadcasting signed tx
Signed-off-by: iuricmp <[email protected]>
1 parent 395e6b9 commit d50175f

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

mobile/app/(app)/tosign/index.tsx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { useGnoNativeContext } from '@gnolang/gnonative'
2020
import { router } from 'expo-router'
2121
import { useEffect, useState } from 'react'
2222
import * as Linking from 'expo-linking'
23-
import { ScrollView, View, TouchableOpacity, Text as RNText } from 'react-native'
23+
import { ScrollView, View, TouchableOpacity, Text as RNText, Alert } from 'react-native'
2424
import { Button, ButtonText, FormItem, FormItemInline, Spacer, Text } from '@/modules/ui-components'
2525
import styled from 'styled-components/native'
2626
import PrettyJSON from '../../../modules/ui-components/src/ui/PrettyJSON'
@@ -45,10 +45,9 @@ export default function Page() {
4545
// const session = useAppSelector(selectSession);
4646
// const sessionWanted = useAppSelector(selectSessionWanted);
4747

48-
console.log('txInput', txInput)
49-
console.log('bech32Address', bech32Address)
50-
console.log('clientName', clientName)
51-
console.log('reason', reason)
48+
console.log(
49+
`tosign screen -> broadcast: ${broadcast}, bech32Address: ${bech32Address}, clientName: ${clientName}, reason: ${reason}, txInput: ${txInput}`
50+
)
5251
// console.log('session', session);
5352
// console.log('sessionWanted', sessionWanted);
5453

@@ -100,8 +99,12 @@ export default function Page() {
10099
if (!txInput || !keyInfo) throw new Error('No transaction input or keyInfo found.')
101100

102101
if (broadcast) {
103-
await gnonative.broadcastTxCommit(txInput)
104-
console.log('broadcasting the tx', txInput)
102+
if (!signedTx) {
103+
Alert.alert('No signedTx')
104+
return
105+
}
106+
const res = await gnonative.broadcastTxCommit(signedTx)
107+
console.log('broadcasting the tx', signedTx, res)
105108
router.push('/home')
106109
return
107110
}
@@ -272,11 +275,11 @@ export default function Page() {
272275

273276
<FormItem label="Raw Transaction Data">{txInput && <PrettyJSON data={JSON.parse(txInput || '')} />}</FormItem>
274277

275-
<Ruller />
278+
{/* <Ruller /> */}
276279

277-
<FormItem label="Raw Signed Data">
278-
<TextBodyWhite>{signedTx && <PrettyJSON data={JSON.parse(signedTx || '')} />}</TextBodyWhite>
279-
</FormItem>
280+
{/* <FormItem label="Raw Signed Data">
281+
<TextBodyWhite>{signedTx && <PrettyJSON data={JSON.parse(signedTx)} />}</TextBodyWhite>
282+
</FormItem> */}
280283
</HiddenGroup>
281284
</ScrollView>
282285

0 commit comments

Comments
 (0)