Add SuspendedPayment{Create,Finish,Cancel}

* Add SusPay core tests
* Rename SusPay -> SuspendedPayment (code review)
* Rename cancelAfter -> allowCancelAfter
* Rename suspendedPayment{Finish,Execution}
This commit is contained in:
sentientwaffle
2015-08-31 07:24:55 -07:00
parent 6e98629f9b
commit b134081293
29 changed files with 733 additions and 31 deletions

View File

@@ -67,8 +67,22 @@ function parseOutcome(tx: Object): ?Object {
};
}
function parseMemos(tx: Object): ?Array<Object> {
if (!Array.isArray(tx.Memos) || tx.Memos.length === 0) {
return undefined;
}
return tx.Memos.map((m) => {
return removeUndefined({
type: m.Memo.parsed_memo_type,
format: m.Memo.parsed_memo_format,
data: m.Memo.parsed_memo_data
});
});
}
module.exports = {
parseOutcome,
parseMemos,
removeUndefined,
adjustQualityForXRP,
dropsToXrp: utils.common.dropsToXrp,