Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"@quasar/extras": "^1.13.4",
"@wharfkit/antelope": "1.0.10",
"@wharfkit/antelope": "1.0.13",
"@wharfkit/session": "^1.3.1",
"@wharfkit/transact-plugin-resource-provider": "^1.1.1",
"@wharfkit/wallet-plugin-anchor": "^1.3.4",
Expand Down
32 changes: 32 additions & 0 deletions src/pages/ProposalItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { sleep } from 'src/utils/time';
import { computed, defineComponent, onMounted, ref } from 'vue';
import JsonViewer from 'vue-json-viewer';
import { useRoute, useRouter } from 'vue-router';
import { TableIndexType } from 'src/types/Api';
import { PackedTransaction, Checksum256 } from '@wharfkit/antelope/lib/eosio-core';

export default defineComponent({
name: 'ProposalItem',
Expand All @@ -29,6 +31,7 @@ export default defineComponent({
const isLoading = ref(true);

const proposer = ref('');
const proposalhash = ref<Checksum256>();
const approvalStatus = ref('');
const expirationDate = ref('');

Expand Down Expand Up @@ -273,6 +276,34 @@ export default defineComponent({
return;
}

const proposalRows = await api.getTableRows({
code: 'eosio.msig',
scope: proposal.proposer,
table: 'proposal',
lower_bound: proposal.proposal_name as unknown as TableIndexType,
upper_bound: proposal.proposal_name as unknown as TableIndexType,
limit: 1,
}) as { rows: { packed_transaction: string }[] };

if (proposalRows.rows.length === 0) {
handleError(null, 'Proposal not found');
await router.push('/proposal');
return;
}

const proposalRow: { packed_transaction: string } = proposalRows.rows[0];

const packed = PackedTransaction.from({
compression: false,
signatures: [],
packed_trx: proposalRow.packed_transaction,
packed_context_free_data: [],
});

const transaction = packed.getTransaction();

proposalhash.value = transaction.id;

proposer.value = proposal.proposer;

const totalRequestedApprovals = proposal.provided_approvals.length + proposal.requested_approvals.length;
Expand Down Expand Up @@ -365,6 +396,7 @@ export default defineComponent({
actor: account.value,
permission: accountStore.accountPermission,
},
proposal_hash: proposalhash.value,
},
});
await sleep();
Expand Down
Loading