Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #103 #108

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions src/api/v1/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 10 additions & 4 deletions test/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
Loading