mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Compile time check preflight returns no tec (RIPD-1624):
The six different ranges of TER codes are broken up into six different enumerations. A template class allows subsets of these enumerations to be aggregated. This technique allows verification at compile time that no TEC codes are returned before the signature is checked. Conversion between TER instance and integer is provided by named functions. This makes accidental conversion almost impossible and makes type abuse easier to spot in the code base.
This commit is contained in:
@@ -1581,8 +1581,8 @@ accountSend (ApplyView& view,
|
||||
// VFALCO Its laborious to have to mutate the
|
||||
// TER based on params everywhere
|
||||
terResult = view.open()
|
||||
? telFAILED_PROCESSING
|
||||
: tecFAILED_PROCESSING;
|
||||
? TER {telFAILED_PROCESSING}
|
||||
: TER {tecFAILED_PROCESSING};
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1847,8 +1847,8 @@ transferXRP (ApplyView& view,
|
||||
// mutating these TER everywhere
|
||||
// FIXME: this logic should be moved to callers maybe?
|
||||
return view.open()
|
||||
? telFAILED_PROCESSING
|
||||
: tecFAILED_PROCESSING;
|
||||
? TER {telFAILED_PROCESSING}
|
||||
: TER {tecFAILED_PROCESSING};
|
||||
}
|
||||
|
||||
// Decrement XRP balance.
|
||||
|
||||
Reference in New Issue
Block a user