Skip to content

Commit

Permalink
fix: change txHash from base64 to hex to be queried
Browse files Browse the repository at this point in the history
  • Loading branch information
ledanghuy1811 committed Oct 7, 2024
1 parent 6346190 commit d616297
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/components/TxDialog/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { sha256 } from '@cosmjs/crypto';
import { toAscii, fromAscii, toBase64 } from '@cosmjs/encoding';
import { toAscii, fromAscii, toHex } from '@cosmjs/encoding';
import { ref, computed } from 'vue';
import {
getAccount,
Expand Down Expand Up @@ -247,7 +247,12 @@ async function sendTx() {
const response = await client.broadcastTx(props.endpoint, txRaw);
if (!response) return;
// show submitting view
hash.value = toBase64(response.hash);
hash.value = toHex(response.hash);
console.log("tx hex here: ", hash.value)
console.log("endpoint: ", props.endpoint)
console.log("chain id: ", chainId.value)
showResult(hash.value);
emit('submited', {
Expand Down Expand Up @@ -294,6 +299,7 @@ function fetchTx(tx: string) {
step.value += 20;
getTxByHash(props.endpoint, tx)
.then((res) => {
console.log("res: ", res)
step.value = 100;
if (res.txResponse!.code > 0) {
error.value = res.txResponse?.rawLog ?? '';
Expand Down

0 comments on commit d616297

Please sign in to comment.