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

feat: support Concise Transaction Identifier (CTID) (XLS-37) #4418

Merged
merged 30 commits into from
Aug 18, 2023
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
5e4f8ea
add CTIM to tx rpc
RichardAH Feb 10, 2023
1daf5f7
Add NetworkID field to Transaction common fields, enforced when netwo…
RichardAH Dec 19, 2022
91b0aae
Update src/ripple/app/tx/impl/Transactor.cpp
RichardAH Dec 21, 2022
2752108
[FOLD] add const, missing include
RichardAH Dec 22, 2022
3782ab7
[FOLD] fix: apply clang-format patch
intelliot Feb 10, 2023
1aaac47
preliminary support for xls37 (Improved Concise Transaction Identifier)
RichardAH Feb 13, 2023
04be722
fix txn hash lookup from index
RichardAH Feb 13, 2023
fec9fb7
rename CTIM to CTID
RichardAH Feb 14, 2023
281f20b
ctid tests
dangell7 Feb 27, 2023
2dad662
add autofill + refactor
dangell7 Mar 21, 2023
f39a839
Merge branch 'develop' into ctim
dangell7 Apr 28, 2023
ccea8c9
clang-format
dangell7 Apr 28, 2023
3a96000
add `'` seperator to hex constants
dangell7 May 29, 2023
5058592
remove impossible validation
dangell7 May 29, 2023
4073a85
pre-increment `it`
dangell7 May 29, 2023
9decc31
add leading 0
dangell7 May 31, 2023
701af50
use boost_regex
dangell7 May 31, 2023
8625bb3
add leading 0
dangell7 May 31, 2023
0728556
`const` after declare variable
dangell7 May 31, 2023
802144b
clang-format
dangell7 May 31, 2023
7f7a93d
add extra check on std::optional
RichardAH Jun 6, 2023
55cbbbd
move guard
dangell7 Jun 27, 2023
38170b6
add test
dangell7 Jun 27, 2023
413388d
update test to match
dangell7 Jun 27, 2023
1f61853
Merge branch 'develop' into ctim
intelliot Jul 12, 2023
027949c
rename `txnIDfromIndex` -> `txnIdFromIndex`
dangell7 Jul 20, 2023
b2ddfde
revert UB guard
dangell7 Jul 20, 2023
80f308f
update test to match guard
dangell7 Jul 20, 2023
32a27c5
fix test naming
RichardAH Jul 20, 2023
61d2f5b
Merge branch 'develop' into ctim
intelliot Jul 26, 2023
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
13 changes: 5 additions & 8 deletions src/ripple/app/ledger/impl/LedgerMaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2376,14 +2376,11 @@ LedgerMaster::txnIDfromIndex(uint32_t ledgerSeq, uint32_t txnIndex)
if (!lgr || lgr->txs.empty())
intelliot marked this conversation as resolved.
Show resolved Hide resolved
return {};

uint32_t counter = 0;
for (auto it = lgr->txs.begin(); it != lgr->txs.end() && counter <= txnIndex; it++, counter++)
{
if (counter != txnIndex)
continue;

return it->first->getTransactionID();
}
for (auto it = lgr->txs.begin(); it != lgr->txs.end(); it++)
if (it->first && it->second &&
it->second->isFieldPresent(sfTransactionIndex) &&
it->second->getFieldU32(sfTransactionIndex) == txnIndex)
return it->first->getTransactionID();

return {};
}
Expand Down