mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-20 03:35:55 +00:00
Add AMM types to AccountTx filter (#954)
This commit is contained in:
@@ -5,15 +5,16 @@ exec 1>&2
|
|||||||
# paths to check and re-format
|
# paths to check and re-format
|
||||||
sources="src unittests"
|
sources="src unittests"
|
||||||
formatter="clang-format -i"
|
formatter="clang-format -i"
|
||||||
version=$($formatter --version | awk -F'[[:space:]]' '{print $4}')
|
version=$($formatter --version | grep -o '[0-9\.]*')
|
||||||
|
|
||||||
if [[ "16.0.0" > "$version" ]]; then
|
if [[ "16.0.0" > "$version" ]]; then
|
||||||
cat <<\EOF
|
cat <<EOF
|
||||||
|
|
||||||
ERROR
|
ERROR
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
A minimum of version 16 of `clang-format` is required.
|
A minimum of version 16 of `clang-format` is required.
|
||||||
Please fix paths and run again.
|
Your version is $version.
|
||||||
|
Please fix paths and run again.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
@@ -24,10 +24,15 @@
|
|||||||
namespace rpc {
|
namespace rpc {
|
||||||
|
|
||||||
// found here : https://xrpl.org/transaction-types.html
|
// found here : https://xrpl.org/transaction-types.html
|
||||||
// TODO [https://github.com/XRPLF/clio/issues/856]: add AMMBid, AMMCreate, AMMDelete, AMMDeposit, AMMVote, AMMWithdraw
|
|
||||||
std::unordered_map<std::string, ripple::TxType> const AccountTxHandler::TYPESMAP{
|
std::unordered_map<std::string, ripple::TxType> const AccountTxHandler::TYPESMAP{
|
||||||
{JSL(AccountSet), ripple::ttACCOUNT_SET},
|
{JSL(AccountSet), ripple::ttACCOUNT_SET},
|
||||||
{JSL(AccountDelete), ripple::ttACCOUNT_DELETE},
|
{JSL(AccountDelete), ripple::ttACCOUNT_DELETE},
|
||||||
|
{JSL(AMMBid), ripple::ttAMM_BID},
|
||||||
|
{JSL(AMMCreate), ripple::ttAMM_CREATE},
|
||||||
|
{JSL(AMMDelete), ripple::ttAMM_DELETE},
|
||||||
|
{JSL(AMMDeposit), ripple::ttAMM_DEPOSIT},
|
||||||
|
{JSL(AMMVote), ripple::ttAMM_VOTE},
|
||||||
|
{JSL(AMMWithdraw), ripple::ttAMM_WITHDRAW},
|
||||||
{JSL(CheckCancel), ripple::ttCHECK_CANCEL},
|
{JSL(CheckCancel), ripple::ttCHECK_CANCEL},
|
||||||
{JSL(CheckCash), ripple::ttCHECK_CASH},
|
{JSL(CheckCash), ripple::ttCHECK_CASH},
|
||||||
{JSL(CheckCreate), ripple::ttCHECK_CREATE},
|
{JSL(CheckCreate), ripple::ttCHECK_CREATE},
|
||||||
|
|||||||
@@ -351,7 +351,7 @@ TEST_P(AccountTxParameterTest, CheckParams)
|
|||||||
{
|
{
|
||||||
mockBackendPtr->updateRange(MINSEQ); // min
|
mockBackendPtr->updateRange(MINSEQ); // min
|
||||||
mockBackendPtr->updateRange(MAXSEQ); // max
|
mockBackendPtr->updateRange(MAXSEQ); // max
|
||||||
auto const testBundle = GetParam();
|
auto const& testBundle = GetParam();
|
||||||
auto* rawBackendPtr = dynamic_cast<MockBackend*>(mockBackendPtr.get());
|
auto* rawBackendPtr = dynamic_cast<MockBackend*>(mockBackendPtr.get());
|
||||||
ASSERT_NE(rawBackendPtr, nullptr);
|
ASSERT_NE(rawBackendPtr, nullptr);
|
||||||
auto const req = json::parse(testBundle.testJson);
|
auto const req = json::parse(testBundle.testJson);
|
||||||
@@ -1502,6 +1502,46 @@ generateTransactionTypeTestValues()
|
|||||||
"tx_type": "AccountDelete"
|
"tx_type": "AccountDelete"
|
||||||
})",
|
})",
|
||||||
"[]"},
|
"[]"},
|
||||||
|
AccountTxTransactionBundle{
|
||||||
|
"AMMBid",
|
||||||
|
R"({
|
||||||
|
"account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
|
||||||
|
"ledger_index": "validated",
|
||||||
|
"tx_type": "AMMBid"
|
||||||
|
})",
|
||||||
|
"[]"},
|
||||||
|
AccountTxTransactionBundle{
|
||||||
|
"AMMCreate",
|
||||||
|
R"({
|
||||||
|
"account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
|
||||||
|
"ledger_index": "validated",
|
||||||
|
"tx_type": "AMMCreate"
|
||||||
|
})",
|
||||||
|
"[]"},
|
||||||
|
AccountTxTransactionBundle{
|
||||||
|
"AMMDelete",
|
||||||
|
R"({
|
||||||
|
"account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
|
||||||
|
"ledger_index": "validated",
|
||||||
|
"tx_type": "AMMDelete"
|
||||||
|
})",
|
||||||
|
"[]"},
|
||||||
|
AccountTxTransactionBundle{
|
||||||
|
"AMMDeposit",
|
||||||
|
R"({
|
||||||
|
"account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
|
||||||
|
"ledger_index": "validated",
|
||||||
|
"tx_type": "AMMDeposit"
|
||||||
|
})",
|
||||||
|
"[]"},
|
||||||
|
AccountTxTransactionBundle{
|
||||||
|
"AMMVote",
|
||||||
|
R"({
|
||||||
|
"account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
|
||||||
|
"ledger_index": "validated",
|
||||||
|
"tx_type": "AMMVote"
|
||||||
|
})",
|
||||||
|
"[]"},
|
||||||
AccountTxTransactionBundle{
|
AccountTxTransactionBundle{
|
||||||
"CheckCancel",
|
"CheckCancel",
|
||||||
R"({
|
R"({
|
||||||
|
|||||||
Reference in New Issue
Block a user