diff --git a/.githooks/pre-commit b/.githooks/pre-commit index e541c4da..7a1b8808 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -5,15 +5,16 @@ exec 1>&2 # paths to check and re-format sources="src unittests" 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 - cat <<\EOF + cat < const AccountTxHandler::TYPESMAP{ {JSL(AccountSet), ripple::ttACCOUNT_SET}, {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(CheckCash), ripple::ttCHECK_CASH}, {JSL(CheckCreate), ripple::ttCHECK_CREATE}, diff --git a/unittests/rpc/handlers/AccountTxTests.cpp b/unittests/rpc/handlers/AccountTxTests.cpp index 8f0a7fc1..5a87d8a3 100644 --- a/unittests/rpc/handlers/AccountTxTests.cpp +++ b/unittests/rpc/handlers/AccountTxTests.cpp @@ -351,7 +351,7 @@ TEST_P(AccountTxParameterTest, CheckParams) { mockBackendPtr->updateRange(MINSEQ); // min mockBackendPtr->updateRange(MAXSEQ); // max - auto const testBundle = GetParam(); + auto const& testBundle = GetParam(); auto* rawBackendPtr = dynamic_cast(mockBackendPtr.get()); ASSERT_NE(rawBackendPtr, nullptr); auto const req = json::parse(testBundle.testJson); @@ -1502,6 +1502,46 @@ generateTransactionTypeTestValues() "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{ "CheckCancel", R"({