Skip to content

Commit a6809f7

Browse files
committed
fix(node): xrpl parseTransaction ordering
1 parent 4798975 commit a6809f7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

node/pkg/watchers/xrpl/parse.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,20 +300,21 @@ func (p *Parser) parseNttTransaction(
300300
}, nil
301301
}
302302

303-
// parseTransaction dispatches to parseCoreTransaction, parseNttTransaction, and parseTicketCreateTransaction.
303+
// parseTransaction dispatches to parseTicketCreateTransaction, parseCoreTransaction, and parseNttTransaction.
304+
// TicketCreate is checked first because it has no Destination field and would fail in the other parsers.
304305
// Returns (nil, nil) if none matched.
305306
func (p *Parser) parseTransaction(tx GenericTx) (*common.MessagePublication, error) {
306-
msg, err := p.parseCoreTransaction(tx)
307+
msg, err := p.parseTicketCreateTransaction(tx)
307308
if msg != nil || err != nil {
308309
return msg, err
309310
}
310311

311-
msg, err = p.parseNttTransaction(tx)
312+
msg, err = p.parseCoreTransaction(tx)
312313
if msg != nil || err != nil {
313314
return msg, err
314315
}
315316

316-
return p.parseTicketCreateTransaction(tx)
317+
return p.parseNttTransaction(tx)
317318
}
318319

319320
// parseCoreTransaction parses a generic Wormhole message (payment to the core account).

0 commit comments

Comments
 (0)