Skip to content

Commit

Permalink
Extra data decoding (#37)
Browse files Browse the repository at this point in the history
* fix transaction data

* show input in textarea

* break text for app details row

* add extra data decoding
  • Loading branch information
n0cte authored Jun 16, 2021
1 parent a3b2a1c commit 993e4ec
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion newclient/src/core/components/ui/AppDetailsListRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</v-flex>
<v-flex v-if="detail.txInput" hidden-sm-and-down sm9 md10>
<div class="data-input pa-3">
<p v-for="(item, index) in detail.txInput" :key="index" class="mb-2">{{ item }}</p>
<p v-for="(item, index) in detail.txInput" :key="index" class="mb-2 break-words">{{ item }}</p>
</div>
</v-flex>
</v-layout>
Expand Down
4 changes: 4 additions & 0 deletions newclient/src/css/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ p {
font-size: 14px;
}

.break-words {
word-break: break-all;
}

/* Global Tooltip */
.tooltip-border {
border: 1px solid #b4bfd2 !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import BN from 'bignumber.js'
import { ErrorMessageBlock } from '@app/modules/blocks/models/ErrorMessagesForBlock'
import newBlockFeed from '../../NewBlockSubscription/newBlockFeed.graphql'
import { excpBlockNotMined } from '@app/apollo/exceptions/errorExceptions'
import { decodeHeaderData } from '@vulcanize/eth-watcher-ts/dist/utils'
import { decodeHeaderData, decodeExtra } from '@vulcanize/eth-watcher-ts/dist/utils'
@Component({
components: {
Expand Down Expand Up @@ -218,7 +218,10 @@ export default class BlockDetails extends Mixins(NumberFormatMixin, NewBlockSubs
},
{
title: this.$i18n.t('block.data'),
detail: this.header.extra,
txInput: [
decodeExtra(this.header.extra),
`(Hex: ${this.header.extra})`
],
mono: true
},
Expand All @@ -228,7 +231,7 @@ export default class BlockDetails extends Mixins(NumberFormatMixin, NewBlockSubs
},
{
title: this.$i18n.t('gas.used'),
detail: this.formatNumber(+this.header.gasUsed)
detail: this.formatNumber(new BN(this.header.gasUsed, 16))
},
{
title: this.$i18n.t('block.logs'),
Expand Down
4 changes: 2 additions & 2 deletions newclient/src/modules/txs/handlers/TxDetails/TxDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export default class TxDetails extends Mixins(NumberFormatMixin) {
row.toChecksum = true
break
case 'tx.to':
row.detail = tx.to
row.detail = `0x${tx.to}`
row.copy = true
row.mono = true
row.toChecksum = true
Expand Down Expand Up @@ -195,7 +195,7 @@ export default class TxDetails extends Mixins(NumberFormatMixin) {
row.detail = this.$i18n.t(this.status).toString()
break
case 'tx.input':
row.detail = tx.input || '0x'
row.txInput = [ `0x${tx.input}` ]
break
}
return row
Expand Down

0 comments on commit 993e4ec

Please sign in to comment.