hashgraph / hedera-mirror-node

Hedera Mirror Node archives data from consensus nodes and serves it via an API
Apache License 2.0
147 stars 112 forks source link

Nonce Filter Is Ignored on /api/v1/transactions/{hash} #9715

Open jnels124 opened 1 week ago

jnels124 commented 1 week ago

Description

The nonce query param is only respected when making request with the transaction id and not when request is made with transaction hash.

Steps to reproduce

Given the following request:

 curl -X 'GET' \                                                                                                                                                                                        
'https://testnet.mirrornode.hedera.com/api/v1/transactions/r6rpaXaYCvy9pPnCfO0f64IoDf0TrnNU0dHfFFbeOeBvhivdO+rcP134dCb44LkA?nonce=0' \
 -H 'accept: application/json'

The following result will be returned(correct):

{"transactions":[{"bytes":null,"charged_tx_fee":207448,"consensus_timestamp":"1730913223.447111312","entity_id":null,"max_fee":"2655000000","memo_base64":"","name":"ETHEREUMTRANSACTION","nft_transfers":[],"node":"0.0.3","nonce":0,"parent_consensus_timestamp":null,"result":"WRONG_NONCE","scheduled":false,"staking_reward_transfers":[],"token_transfers":[],"transaction_hash":"r6rpaXaYCvy9pPnCfO0f64IoDf0TrnNU0dHfFFbeOeBvhivdO+rcP134dCb44LkA","transaction_id":"0.0.902-1730913210-989942481","transfers":[{"account":"0.0.3","amount":7413,"is_approval":false},{"account":"0.0.98","amount":180032,"is_approval":false},{"account":"0.0.800","amount":20003,"is_approval":false},{"account":"0.0.902","amount":-207448,"is_approval":false}],"valid_duration_seconds":"120","valid_start_timestamp":"1730913210.989942481"}]}

However with the following request with the wrong nonce filter still returns the result

curl -X 'GET' \                                                                                                              
'https://testnet.mirrornode.hedera.com/api/v1/transactions/r6rpaXaYCvy9pPnCfO0f64IoDf0TrnNU0dHfFFbeOeBvhivdO+rcP134dCb44LkA?nonce=1000' \
 -H 'accept: application/json'

Additional context

No response

Hedera network

testnet

Version

v0.117.0

Operating system

None

AsfarHorani commented 1 week ago

Hi @jnels124 can u assign it to me? I am willing to solve it