File tree Expand file tree Collapse file tree 3 files changed +9
-22
lines changed
Expand file tree Collapse file tree 3 files changed +9
-22
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ const transactionsByPactCodeQuery = `
8787 canonical
8888 chainId
8989 creationTime
90+ badResult
9091 gas
9192 gasLimit
9293 gasPrice
@@ -398,21 +399,16 @@ export function useSearch () {
398399
399400 const edges = codeResponse ?. data ?. transactionsByPactCode ?. edges || [ ] ;
400401 if ( currentQuery === data . query && edges . length ) {
401- // TEMP: convert unix seconds to ISO for creationTime until API returns ISO
402- const toIso = ( v : any ) : string => {
403- if ( typeof v === 'number' ) return new Date ( v * 1000 ) . toISOString ( ) ;
404- if ( typeof v === 'string' && / ^ \d + $ / . test ( v ) ) return new Date ( parseInt ( v , 10 ) * 1000 ) . toISOString ( ) ;
405- return new Date ( v ) . toISOString ( ) ;
406- } ;
407-
408402 const codeItems = edges . map ( ( edge : any ) => {
409403 const n = edge . node ;
410- const resultString = '{"status":"success","badResult":null}' ;
404+ const resultString = ( n ?. badResult !== null && n ?. badResult !== undefined )
405+ ? `{"status":"error","badResult":${ JSON . stringify ( n . badResult ) } }`
406+ : '{"status":"success","badResult":null}' ;
411407 return {
412408 requestkey : n . requestKey ,
413409 chainId : n . chainId ,
414410 height : n . height ,
415- creationTime : toIso ( n . creationTime ) ,
411+ creationTime : n . creationTime ,
416412 result : resultString ,
417413 } ;
418414 } ) ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ const GQL_QUERY = `
1616 canonical
1717 chainId
1818 creationTime
19+ badResult
1920 gas
2021 gasLimit
2122 gasPrice
@@ -91,22 +92,16 @@ export const useTransactionsByPactCode = () => {
9192 }
9293
9394 const rawTxs = result . edges ;
94- // TEMP: convert unix seconds to ISO until API returns ISO
95- const toIso = ( v : any ) : string => {
96- if ( typeof v === 'number' ) return new Date ( v * 1000 ) . toISOString ( ) ;
97- if ( typeof v === 'string' && / ^ \d + $ / . test ( v ) ) return new Date ( parseInt ( v , 10 ) * 1000 ) . toISOString ( ) ;
98- return new Date ( v ) . toISOString ( ) ;
99- } ;
10095
10196 transactions . value = rawTxs . map ( ( edge : any ) => {
10297 const n = edge . node ;
10398 return {
10499 requestKey : n . requestKey ,
105100 height : n . height ,
106101 canonical : n . canonical ,
107- badResult : null ,
102+ badResult : n . badResult ,
108103 chainId : n . chainId ,
109- time : formatRelativeTime ( toIso ( n . creationTime ) ) ,
104+ time : formatRelativeTime ( n . creationTime ) ,
110105 sender : n . sender ,
111106 gasPrice : formatGasPrice ( parseFloat ( n . gasPrice ) ) ,
112107 rawGasPrice : n . gasPrice ,
Original file line number Diff line number Diff line change @@ -329,6 +329,7 @@ const formattedGasInfo = computed(() => {
329329
330330// Execution Result badge mapping (Good/Bad)
331331const executionResultBadge = computed (() => {
332+ console .log (' transactionExecutionResult' , transactionExecutionResult .value )
332333 if (! transactionExecutionResult ?.value ) return null
333334 if (transactionExecutionResult .value .type === ' badResult' ) {
334335 return {
@@ -783,11 +784,6 @@ onUnmounted(() => {
783784 <div class =" flex-1 text-[#fafafa]" >
784785 {{ transactionExecutionResult.value }}
785786 </div >
786- <!-- <textarea
787- readonly
788- :value="transactionExecutionResult.value"
789- class="flex-1 w-full min-w-0 bg-[#151515] border border-[#222222] rounded-lg text-[#bbbbbb] text-sm px-[10px] py-[8px] outline-none font-mono whitespace-pre-wrap overflow-auto break-all resize-none"
790- ></textarea> -->
791787 </div >
792788 </template >
793789 </LabelValue >
You can’t perform that action at this time.
0 commit comments