mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
Claim a fee when a required destination tag is not specified (RIPD-574)
This commit is contained in:
@@ -241,7 +241,7 @@ public:
|
||||
// no way for this field to be set.
|
||||
m_journal.trace << "Malformed transaction: DestinationTag required.";
|
||||
|
||||
return tefDST_TAG_NEEDED;
|
||||
return tecDST_TAG_NEEDED;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -105,7 +105,6 @@ enum TER // aka TransactionEngineResult
|
||||
tefBAD_AUTH,
|
||||
tefBAD_LEDGER,
|
||||
tefCREATED,
|
||||
tefDST_TAG_NEEDED,
|
||||
tefEXCEPTION,
|
||||
tefINTERNAL,
|
||||
tefNO_AUTH_REQUIRED, // Can't set auth if auth is not required.
|
||||
@@ -193,6 +192,7 @@ enum TER // aka TransactionEngineResult
|
||||
tecNO_ENTRY = 140,
|
||||
tecINSUFFICIENT_RESERVE = 141,
|
||||
tecNEED_MASTER_KEY = 142,
|
||||
tecDST_TAG_NEEDED = 143,
|
||||
};
|
||||
|
||||
inline bool isTelLocal(TER x)
|
||||
|
||||
@@ -66,13 +66,13 @@ bool transResultInfo (TER code, std::string& token, std::string& text)
|
||||
{ tecNO_ENTRY, "tecNO_ENTRY", "No matching entry found." },
|
||||
{ tecINSUFFICIENT_RESERVE, "tecINSUFFICIENT_RESERVE", "Insufficient reserve to complete requested operation." },
|
||||
{ tecNEED_MASTER_KEY, "tecNEED_MASTER_KEY", "The operation requires the use of the Master Key." },
|
||||
{ tecDST_TAG_NEEDED, "tecDST_TAG_NEEDED", "A destination tag is required." },
|
||||
|
||||
{ tefALREADY, "tefALREADY", "The exact transaction was already in this ledger." },
|
||||
{ tefBAD_ADD_AUTH, "tefBAD_ADD_AUTH", "Not authorized to add account." },
|
||||
{ tefBAD_AUTH, "tefBAD_AUTH", "Transaction's public key is not authorized." },
|
||||
{ tefBAD_LEDGER, "tefBAD_LEDGER", "Ledger in unexpected state." },
|
||||
{ tefCREATED, "tefCREATED", "Can't add an already created account." },
|
||||
{ tefDST_TAG_NEEDED, "tefDST_TAG_NEEDED", "Destination tag required." },
|
||||
{ tefEXCEPTION, "tefEXCEPTION", "Unexpected program state." },
|
||||
{ tefFAILURE, "tefFAILURE", "Failed to apply." },
|
||||
{ tefINTERNAL, "tefINTERNAL", "Internal error." },
|
||||
|
||||
@@ -53,26 +53,6 @@ make_suite('Robust transaction submission', function() {
|
||||
testutils.create_accounts($.remote, 'root', '20000.0', [ 'alice', 'bob' ], callback);
|
||||
},
|
||||
|
||||
function setRequireDestTag(callback) {
|
||||
self.what = 'Set RequireDestTag';
|
||||
|
||||
var tx = $.remote.transaction().account_set('alice');
|
||||
tx.set_flags('RequireDestTag');
|
||||
|
||||
tx.once('submitted', function(m) {
|
||||
|
||||
assert.strictEqual('tesSUCCESS', m.engine_result);
|
||||
});
|
||||
|
||||
tx.once('final', function() {
|
||||
callback();
|
||||
});
|
||||
|
||||
tx.submit();
|
||||
|
||||
testutils.ledger_wait($.remote, tx);
|
||||
},
|
||||
|
||||
function sendInvalidTransaction(callback) {
|
||||
self.what = 'Send transaction without a destination tag';
|
||||
|
||||
@@ -83,9 +63,12 @@ make_suite('Robust transaction submission', function() {
|
||||
});
|
||||
|
||||
tx.once('submitted', function(m) {
|
||||
assert.strictEqual('tefDST_TAG_NEEDED', m.engine_result);
|
||||
assert.strictEqual('tefMAX_LEDGER', m.engine_result);
|
||||
});
|
||||
|
||||
// Standalone mode starts with the open ledger as 3, so there's no way
|
||||
// for this to be anything other than tefMAX_LEDGER.
|
||||
tx.lastLedger(1);
|
||||
tx.submit();
|
||||
|
||||
//Invoke callback immediately
|
||||
|
||||
Reference in New Issue
Block a user