Skip to content

Commit

Permalink
Fixing Blocks page
Browse files Browse the repository at this point in the history
  • Loading branch information
jaegerfe committed Jun 18, 2024
1 parent 3513876 commit 7c4346d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/transaction/AccountFormat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default defineComponent({
</script>

<template>
<a class="hover-dec" :href=" '/' + type + '/' + accAccount">{{type === 'transaction' ? accAccount.slice(0, 8) : accAccount}}</a>
<a class="hover-dec" :href=" '/' + type + '/' + accAccount">{{type === 'transaction' ? accAccount.toString().slice(0, 8) : accAccount}}</a>
</template>

<style lang="sass" scoped>
Expand Down
22 changes: 20 additions & 2 deletions src/pages/Block.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import TransactionsTable from 'src/components/TransactionsTable.vue';
import BlockCard from 'components/BlockCard.vue';
import { useRoute, useRouter } from 'vue-router';
import { api } from 'src/api';
import { Action, API, Transaction } from '@wharfkit/session';
import { API, Transaction } from '@wharfkit/session';
import { Action } from 'src/types';
import { deserializeActionData } from 'src/api/antelopeV1';
export default defineComponent({
name: 'BlockPage',
Expand All @@ -20,7 +22,23 @@ export default defineComponent({
block.value = await api.getBlock(route.params.block as string);
block.value.transactions.forEach((transactionReceipt) => {
const transaction = transactionReceipt.trx.transaction as Transaction;
actions.value = transaction.actions;
void Promise.all(transaction.actions.map(async (act) => {
const data = await deserializeActionData(act);
console.log('meu teste nojento', data);
return {
...act,
trx_id: transactionReceipt.trx.id,
data: data,
act: {
name: act.name,
data: data,
account: act.account,
},
'@timestamp': block.value.timestamp,
} as unknown as Action;
})).then((acts) => {
actions.value = actions.value.concat(acts);
});
});
found.value = !!block.value;
});
Expand Down

0 comments on commit 7c4346d

Please sign in to comment.