@@ -11,6 +11,8 @@ import { sleep } from 'src/utils/time';
1111import { computed , defineComponent , onMounted , ref } from ' vue' ;
1212import JsonViewer from ' vue-json-viewer' ;
1313import { useRoute , useRouter } from ' vue-router' ;
14+ import { TableIndexType } from ' src/types/Api' ;
15+ import { PackedTransaction , Checksum256 } from ' @wharfkit/antelope/lib/eosio-core' ;
1416
1517export 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