mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
Merge tepPARTIAL into tecCLAIMED.
This commit is contained in:
@@ -2567,8 +2567,7 @@ cLog(lsDEBUG) << boost::str(boost::format("rippleCalc: Summary: %d rate: %s qual
|
|||||||
{
|
{
|
||||||
// Have sent maximum allowed. Partial payment not allowed.
|
// Have sent maximum allowed. Partial payment not allowed.
|
||||||
|
|
||||||
terResult = tepPATH_PARTIAL;
|
terResult = tecPATH_PARTIAL;
|
||||||
lesActive = lesBase; // Revert to just fees charged.
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2581,14 +2580,13 @@ cLog(lsDEBUG) << boost::str(boost::format("rippleCalc: Summary: %d rate: %s qual
|
|||||||
else if (!bPartialPayment)
|
else if (!bPartialPayment)
|
||||||
{
|
{
|
||||||
// Partial payment not allowed.
|
// Partial payment not allowed.
|
||||||
terResult = tepPATH_PARTIAL;
|
terResult = tecPATH_PARTIAL;
|
||||||
lesActive = lesBase; // Revert to just fees charged.
|
|
||||||
}
|
}
|
||||||
// Partial payment ok.
|
// Partial payment ok.
|
||||||
else if (!saDstAmountAct)
|
else if (!saDstAmountAct)
|
||||||
{
|
{
|
||||||
// No payment at all.
|
// No payment at all.
|
||||||
terResult = tecPATH_DRY; // Revert to just fees charged is built into tec.
|
terResult = tecPATH_DRY;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -116,10 +116,6 @@ TER TransactionEngine::applyTransaction(const SerializedTransaction& txn, Transa
|
|||||||
{
|
{
|
||||||
didApply = true;
|
didApply = true;
|
||||||
}
|
}
|
||||||
else if (isTepPartial(terResult) && !isSetBit(params, tapRETRY))
|
|
||||||
{
|
|
||||||
didApply = true;
|
|
||||||
}
|
|
||||||
else if (isTecClaim(terResult) && !isSetBit(params, tapRETRY))
|
else if (isTecClaim(terResult) && !isSetBit(params, tapRETRY))
|
||||||
{ // only claim the transaction fee
|
{ // only claim the transaction fee
|
||||||
cLog(lsINFO) << "Reprocessing to only claim fee";
|
cLog(lsINFO) << "Reprocessing to only claim fee";
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ bool transResultInfo(TER terCode, std::string& strToken, std::string& strHuman)
|
|||||||
{ tecNO_LINE_INSUF_RESERVE, "tecNO_LINE_INSUF_RESERVE", "No such line. Too little reserve to create it." },
|
{ tecNO_LINE_INSUF_RESERVE, "tecNO_LINE_INSUF_RESERVE", "No such line. Too little reserve to create it." },
|
||||||
{ tecNO_LINE_REDUNDANT, "tecNO_LINE_REDUNDANT", "Can't set non-existant line to default." },
|
{ tecNO_LINE_REDUNDANT, "tecNO_LINE_REDUNDANT", "Can't set non-existant line to default." },
|
||||||
{ tecPATH_DRY, "tecPATH_DRY", "Path could not send partial amount." },
|
{ tecPATH_DRY, "tecPATH_DRY", "Path could not send partial amount." },
|
||||||
|
{ tecPATH_PARTIAL, "tecPATH_PARTIAL", "Path could not send full amount." },
|
||||||
|
|
||||||
{ tecUNFUNDED, "tecUNFUNDED", "Source account had insufficient balance for transaction." },
|
{ tecUNFUNDED, "tecUNFUNDED", "Source account had insufficient balance for transaction." },
|
||||||
|
|
||||||
{ tefFAILURE, "tefFAILURE", "Failed to apply." },
|
{ tefFAILURE, "tefFAILURE", "Failed to apply." },
|
||||||
@@ -58,9 +60,6 @@ bool transResultInfo(TER terCode, std::string& strToken, std::string& strHuman)
|
|||||||
{ temUNCERTAIN, "temUNCERTAIN", "In process of determining result. Never returned." },
|
{ temUNCERTAIN, "temUNCERTAIN", "In process of determining result. Never returned." },
|
||||||
{ temUNKNOWN, "temUNKNOWN", "The transactions requires logic not implemented yet." },
|
{ temUNKNOWN, "temUNKNOWN", "The transactions requires logic not implemented yet." },
|
||||||
|
|
||||||
{ tepPARTIAL, "tepPARTIAL", "Partial success." },
|
|
||||||
{ tepPATH_PARTIAL, "tepPATH_PARTIAL", "Path could not send full amount." },
|
|
||||||
|
|
||||||
{ terRETRY, "terRETRY", "Retry transaction." },
|
{ terRETRY, "terRETRY", "Retry transaction." },
|
||||||
{ terFUNDS_SPENT, "terFUNDS_SPENT", "Can't set password, password set funds already spent." },
|
{ terFUNDS_SPENT, "terFUNDS_SPENT", "Can't set password, password set funds already spent." },
|
||||||
{ terINSUF_FEE_B, "terINSUF_FEE_B", "Account balance can't pay fee." },
|
{ terINSUF_FEE_B, "terINSUF_FEE_B", "Account balance can't pay fee." },
|
||||||
|
|||||||
@@ -92,20 +92,9 @@ enum TER // aka TransactionEngineResult
|
|||||||
// - Forwarded
|
// - Forwarded
|
||||||
tesSUCCESS = 0,
|
tesSUCCESS = 0,
|
||||||
|
|
||||||
// 100 .. 119 P Partial success (SR) (ripple transaction with no good paths, pay to non-existent account)
|
// 100 .. 129 C Claim fee only (ripple transaction with no good paths, pay to non-existent account, no path)
|
||||||
// Causes:
|
// Causes:
|
||||||
// - Success, but does not achieve optimal result.
|
// - Success, but does not achieve optimal result.
|
||||||
// Implications:
|
|
||||||
// - Applied
|
|
||||||
// - Forwarded
|
|
||||||
// Only allowed as a return code of appliedTransaction when !tapRetry. Otherwise, treated as terRETRY.
|
|
||||||
//
|
|
||||||
// DO NOT CHANGE THESE NUMBERS: They appear in ledger meta data.
|
|
||||||
tepPARTIAL = 100,
|
|
||||||
tepPATH_PARTIAL = 101,
|
|
||||||
|
|
||||||
// 120 .. C Claim fee only (CO) (no path)
|
|
||||||
// Causes:
|
|
||||||
// - Invalid transaction or no effect, but claim fee to use the sequence number.
|
// - Invalid transaction or no effect, but claim fee to use the sequence number.
|
||||||
// Implications:
|
// Implications:
|
||||||
// - Applied
|
// - Applied
|
||||||
@@ -113,7 +102,8 @@ enum TER // aka TransactionEngineResult
|
|||||||
// Only allowed as a return code of appliedTransaction when !tapRetry. Otherwise, treated as terRETRY.
|
// Only allowed as a return code of appliedTransaction when !tapRetry. Otherwise, treated as terRETRY.
|
||||||
//
|
//
|
||||||
// DO NOT CHANGE THESE NUMBERS: They appear in ledger meta data.
|
// DO NOT CHANGE THESE NUMBERS: They appear in ledger meta data.
|
||||||
tecCLAIM = 120,
|
tecCLAIM = 100,
|
||||||
|
tecPATH_PARTIAL = 101,
|
||||||
tecDIR_FULL = 121,
|
tecDIR_FULL = 121,
|
||||||
tecINSUF_RESERVE_LINE = 122,
|
tecINSUF_RESERVE_LINE = 122,
|
||||||
tecINSUF_RESERVE_OFFER = 123,
|
tecINSUF_RESERVE_OFFER = 123,
|
||||||
@@ -130,7 +120,6 @@ enum TER // aka TransactionEngineResult
|
|||||||
#define isTefFailure(x) ((x) >= tefFAILURE && (x) < terRETRY)
|
#define isTefFailure(x) ((x) >= tefFAILURE && (x) < terRETRY)
|
||||||
#define isTerRetry(x) ((x) >= terRETRY && (x) < tesSUCCESS)
|
#define isTerRetry(x) ((x) >= terRETRY && (x) < tesSUCCESS)
|
||||||
#define isTepSuccess(x) ((x) >= tesSUCCESS)
|
#define isTepSuccess(x) ((x) >= tesSUCCESS)
|
||||||
#define isTepPartial(x) ((x) >= tepPATH_PARTIAL && (x) < tecCLAIM)
|
|
||||||
#define isTecClaim(x) ((x) >= tecCLAIM)
|
#define isTecClaim(x) ((x) >= tecCLAIM)
|
||||||
|
|
||||||
bool transResultInfo(TER terCode, std::string& strToken, std::string& strHuman);
|
bool transResultInfo(TER terCode, std::string& strToken, std::string& strHuman);
|
||||||
|
|||||||
@@ -1162,7 +1162,7 @@ Remote.prototype.transaction = function () {
|
|||||||
// |/
|
// |/
|
||||||
// |- 'tesSUCCESS' - Transaction in ledger as expected.
|
// |- 'tesSUCCESS' - Transaction in ledger as expected.
|
||||||
// |- 'ter...' - Transaction failed.
|
// |- 'ter...' - Transaction failed.
|
||||||
// \- 'tep...' - Transaction partially succeeded.
|
// \- 'tec...' - Transaction claimed fee only.
|
||||||
//
|
//
|
||||||
// Notes:
|
// Notes:
|
||||||
// - All transactions including those with local and malformed errors may be
|
// - All transactions including those with local and malformed errors may be
|
||||||
@@ -1225,7 +1225,7 @@ Transaction.prototype.consts = {
|
|||||||
'tefFAILURE' : -199,
|
'tefFAILURE' : -199,
|
||||||
'terRETRY' : -99,
|
'terRETRY' : -99,
|
||||||
'tesSUCCESS' : 0,
|
'tesSUCCESS' : 0,
|
||||||
'tepPARTIAL' : 100,
|
'tecCLAIMED' : 100,
|
||||||
};
|
};
|
||||||
|
|
||||||
Transaction.prototype.isTelLocal = function (ter) {
|
Transaction.prototype.isTelLocal = function (ter) {
|
||||||
@@ -1248,8 +1248,8 @@ Transaction.prototype.isTepSuccess = function (ter) {
|
|||||||
return ter >= this.consts.tesSUCCESS;
|
return ter >= this.consts.tesSUCCESS;
|
||||||
};
|
};
|
||||||
|
|
||||||
Transaction.prototype.isTepPartial = function (ter) {
|
Transaction.prototype.isTecClaimed = function (ter) {
|
||||||
return ter >= this.consts.tepPATH_PARTIAL;
|
return ter >= this.consts.tecCLAIMED;
|
||||||
};
|
};
|
||||||
|
|
||||||
Transaction.prototype.isRejected = function (ter) {
|
Transaction.prototype.isRejected = function (ter) {
|
||||||
|
|||||||
@@ -602,7 +602,7 @@ buster.testCase("Offer tests", {
|
|||||||
.on('proposed', function (m) {
|
.on('proposed', function (m) {
|
||||||
// console.log("proposed: %s", JSON.stringify(m));
|
// console.log("proposed: %s", JSON.stringify(m));
|
||||||
|
|
||||||
callback(m.result !== 'tepPATH_PARTIAL');
|
callback(m.result !== 'tecPATH_PARTIAL');
|
||||||
})
|
})
|
||||||
.submit();
|
.submit();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -549,7 +549,7 @@ buster.testCase("Indirect ripple", {
|
|||||||
.on('proposed', function (m) {
|
.on('proposed', function (m) {
|
||||||
// console.log("proposed: %s", JSON.stringify(m));
|
// console.log("proposed: %s", JSON.stringify(m));
|
||||||
|
|
||||||
callback(m.result !== 'tepPATH_PARTIAL');
|
callback(m.result !== 'tecPATH_PARTIAL');
|
||||||
})
|
})
|
||||||
.submit();
|
.submit();
|
||||||
},
|
},
|
||||||
@@ -561,7 +561,7 @@ buster.testCase("Indirect ripple", {
|
|||||||
.on('proposed', function (m) {
|
.on('proposed', function (m) {
|
||||||
// console.log("proposed: %s", JSON.stringify(m));
|
// console.log("proposed: %s", JSON.stringify(m));
|
||||||
|
|
||||||
callback(m.result !== 'tepPATH_PARTIAL');
|
callback(m.result !== 'tecPATH_PARTIAL');
|
||||||
})
|
})
|
||||||
.submit();
|
.submit();
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user