-
Notifications
You must be signed in to change notification settings - Fork 0
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
Incorrect status returned by GetTransactionStatus
#2167
Comments
So at the moment transaction statuses are based off the fields let status_code =
if receipt.accepted.is_some() && receipt.accepted.unwrap() && receipt.success {
TxnStatusCode::Confirmed // 3
} else if receipt.success {
TxnStatusCode::Dispatched // 1
} else {
let errors: Vec<ScillaError> =
receipt.errors.into_iter().flat_map(|(_k, v)| v).collect();
if errors.len() == 1 {
match errors[0] {
ScillaError::CallContractFailed => TxnStatusCode::FailScillaLib,
ScillaError::CreateContractFailed => TxnStatusCode::Error,
ScillaError::GasNotSufficient => TxnStatusCode::InsufficientGas,
ScillaError::BalanceTransferFailed => TxnStatusCode::InsufficientBalance,
_ => TxnStatusCode::Error,
}
} else {
TxnStatusCode::Error
}
}; So in this case, if a status of 1 is being returned, this implies that either |
IMO, Based on the description in the docs, status code 2 is the same as I'm not sure if I tried to look up the semantics of these fields and codes in the old Zilliqa 1 dev docs, but it was not as helpful as I expected: https://dev.zilliqa.com/zilliqa1/developers/transaction-lifecycle/dev-txn-receipt/ |
Sorry I put in the pull request before I saw your reply. If you take a look in PR #2170 I've dropped support for |
|
So that sounds like the previous implementation was correct? We should be returning Confirmed (3) if and only if I've just noticed the discussion on Slack and that appears to support that? |
Where is the discussion on Slack? My understanding of Thanks for clarifying the meaning of I'll send an invite to discuss how to handle these legacy status codes inherited from Zilliqa 1 @maxconway @JamesHinshelwood |
Yep good idea re a discussion on this. Just for reference, I've traced through where these fields in the receipt are used: AFAICS,
So its semantics are only relevant in terms of being produced by the converter and
|
New statuses will be:
|
The status should be 3 according to https://dev.zilliqa.com/zilliqa2/api/apis/api/zilliqa/GetTransactionStatus/ but the value returned is 1 e.g.:
The text was updated successfully, but these errors were encountered: