Skip to content

Commit 18c1690

Browse files
authored
Merge pull request #879 from telosnetwork/develop
2 parents a708883 + 53523ad commit 18c1690

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"dependencies": {
1616
"@quasar/extras": "^1.13.4",
17-
"@wharfkit/antelope": "1.0.10",
17+
"@wharfkit/antelope": "1.0.13",
1818
"@wharfkit/session": "^1.3.1",
1919
"@wharfkit/transact-plugin-resource-provider": "^1.1.1",
2020
"@wharfkit/wallet-plugin-anchor": "^1.3.4",

src/pages/ProposalItem.vue

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import { sleep } from 'src/utils/time';
1111
import { computed, defineComponent, onMounted, ref } from 'vue';
1212
import JsonViewer from 'vue-json-viewer';
1313
import { useRoute, useRouter } from 'vue-router';
14+
import { TableIndexType } from 'src/types/Api';
15+
import { PackedTransaction, Checksum256 } from '@wharfkit/antelope/lib/eosio-core';
1416
1517
export default defineComponent({
1618
name: 'ProposalItem',
@@ -29,6 +31,7 @@ export default defineComponent({
2931
const isLoading = ref(true);
3032
3133
const proposer = ref('');
34+
const proposalhash = ref<Checksum256>();
3235
const approvalStatus = ref('');
3336
const expirationDate = ref('');
3437
@@ -273,6 +276,34 @@ export default defineComponent({
273276
return;
274277
}
275278
279+
const proposalRows = await api.getTableRows({
280+
code: 'eosio.msig',
281+
scope: proposal.proposer,
282+
table: 'proposal',
283+
lower_bound: proposal.proposal_name as unknown as TableIndexType,
284+
upper_bound: proposal.proposal_name as unknown as TableIndexType,
285+
limit: 1,
286+
}) as { rows: { packed_transaction: string }[] };
287+
288+
if (proposalRows.rows.length === 0) {
289+
handleError(null, 'Proposal not found');
290+
await router.push('/proposal');
291+
return;
292+
}
293+
294+
const proposalRow: { packed_transaction: string } = proposalRows.rows[0];
295+
296+
const packed = PackedTransaction.from({
297+
compression: false,
298+
signatures: [],
299+
packed_trx: proposalRow.packed_transaction,
300+
packed_context_free_data: [],
301+
});
302+
303+
const transaction = packed.getTransaction();
304+
305+
proposalhash.value = transaction.id;
306+
276307
proposer.value = proposal.proposer;
277308
278309
const totalRequestedApprovals = proposal.provided_approvals.length + proposal.requested_approvals.length;
@@ -365,6 +396,7 @@ export default defineComponent({
365396
actor: account.value,
366397
permission: accountStore.accountPermission,
367398
},
399+
proposal_hash: proposalhash.value,
368400
},
369401
});
370402
await sleep();

0 commit comments

Comments
 (0)