From e52daec94cf3140481aa74cb1131a6ed861397e2 Mon Sep 17 00:00:00 2001 From: Guras Date: Tue, 2 Jul 2024 19:44:29 -0400 Subject: [PATCH 1/2] Fix issue #103 Update GetTransactionStatusResponse to match new API structure - Add new fields: block_number, block_id, block_timestamp, expiration - Retain existing fields to maintain compatibility - Ensure field types align with API response data types --- src/api/v1/types.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api/v1/types.ts b/src/api/v1/types.ts index 90479cc..caf4712 100644 --- a/src/api/v1/types.ts +++ b/src/api/v1/types.ts @@ -655,6 +655,10 @@ export class GetCurrencyStatsItemResponse extends Struct { @Struct.type('get_transaction_status_response') export class GetTransactionStatusResponse extends Struct { @Struct.field('string') declare state: string + @Struct.field('uint32') declare block_number: UInt32 + @Struct.field(BlockId) declare block_id: BlockId + @Struct.field('time_point') declare block_timestamp: TimePoint + @Struct.field('time_point') declare expiration: TimePoint @Struct.field('uint32') declare head_number: UInt32 @Struct.field(BlockId) declare head_id: BlockId @Struct.field('time_point') declare head_timestamp: TimePoint From 1cfd0501614933b2e26984b9e6151eab29a001df Mon Sep 17 00:00:00 2001 From: Guras Date: Thu, 11 Jul 2024 21:07:37 -0400 Subject: [PATCH 2/2] WiP: Setup test case --- test/api.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/test/api.ts b/test/api.ts index 16f64ac..9bbe81d 100644 --- a/test/api.ts +++ b/test/api.ts @@ -767,10 +767,16 @@ suite('api v1', function () { }) test('chain get_transaction_status', async function () { - const res = await jungle4.v1.chain.get_transaction_status( - '153207ae7b30621421b968fa3c327db0d89f70975cf2bee7f8118c336094019a' - ) - assert.equal(res.state, 'UNKNOWN') + try { + const transactionId = Checksum256.from('fdbb52d81bd8fdd5e4d03186a5c509bfed6cb6609dc76a1b1893444351f40315') + + const res = await jungle4.v1.chain.get_transaction_status(transactionId) + + console.log('Decoded response:', JSON.stringify(res, null, 2)) + } catch (error) { + console.error('Error fetching transaction status:', error) + throw error + } }) test('chain set_abi w/ action results', async function () {