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

TX page has non-exhaustive handling of TX statuses #1907

Open
hstove opened this issue Nov 12, 2024 · 0 comments · May be fixed by #1919
Open

TX page has non-exhaustive handling of TX statuses #1907

hstove opened this issue Nov 12, 2024 · 0 comments · May be fixed by #1919
Assignees

Comments

@hstove
Copy link
Contributor

hstove commented Nov 12, 2024

When a TX has the status of dropped_problematic, the explorer shows the TX as "in mempool". This is because "dropped_problematic" isn't handled.

const txStatusLabelMap = {

More critically, this function should include dropped_problematic at line ~22:

export function getTransactionStatus(tx: Transaction | MempoolTransaction) {
if (tx?.tx_status === 'success' && (tx.is_unanchored || tx?.block_hash === '0x')) {
return TransactionStatus.SUCCESS_MICROBLOCK;
} else if (tx?.tx_status === 'success' && !tx.is_unanchored) {
if (!tx.canonical || !tx.microblock_canonical) {
return TransactionStatus.NON_CANONICAL;
} else {
return TransactionStatus.SUCCESS_ANCHOR_BLOCK;
}
} else if (tx?.tx_status === 'abort_by_response' || tx?.tx_status === 'abort_by_post_condition') {
return TransactionStatus.FAILED;
} else if (
tx?.tx_status === 'dropped_replace_across_fork' ||
tx?.tx_status === 'dropped_replace_by_fee' ||
tx?.tx_status === 'dropped_stale_garbage_collect' ||
tx?.tx_status === 'dropped_too_expensive'
) {
return TransactionStatus.DROPPED;

CC: stacks-network/stacks-core#5128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

Successfully merging a pull request may close this issue.

2 participants