Skip to content

Commit

Permalink
fix: Oracle response of OracleRespondTx transactions is not displayed…
Browse files Browse the repository at this point in the history
… correctly (#358)
  • Loading branch information
janmichek authored Aug 10, 2023
1 parent 7a4aafb commit 0ccbe21
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/components/TransactionCellOracleRespondTx.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

<value-hash-ellipsed :hash="transactionData.queryId"/>

<app-chip size="sm">
<app-chip
v-if="oracleResponse"
size="sm">
{{ oracleResponse }}
</app-chip>
</template>
Expand All @@ -16,15 +18,17 @@
import AppChip from '@/components/AppChip'
import TransactionArrowRightIcon from '@/components/TransactionArrowRightIcon'
import ValueHashEllipsed from '@/components/ValueHashEllipsed'
import { formatDecodeByteArray, formatEllipseHash } from '@/utils/format'
import { formatDecodeByteArray } from '@/utils/format'
const props = defineProps({
transactionData: {
required: true,
type: Object,
},
})
const oracleResponse = computed(() =>
formatEllipseHash(formatDecodeByteArray(props.transactionData.response)),
)
const oracleResponse = computed(() => {
const { response } = props.transactionData
const decodedResponse = response instanceof Array ? formatDecodeByteArray(response) : response.toString()
return decodedResponse.length > 8 ? decodedResponse.slice(0, 8) : decodedResponse
})
</script>

0 comments on commit 0ccbe21

Please sign in to comment.