WIP Generic data handling and caching

Add basic support for reimbursements via new, generic data handling
functions.
This commit is contained in:
2020-06-27 16:35:04 +02:00
parent 4a9dd5ff09
commit 95743330e4
8 changed files with 1409 additions and 519 deletions
+20
View File
@@ -0,0 +1,20 @@
export default function processReimbursementData(data) {
const processed = {}
if (data.confirmedAtBlock && (typeof data.confirmedAtBlock.toNumber === 'function')) {
processed.confirmedAt = data.confirmedAtBlock.toNumber();
} else if (data.confirmedAt !== 'undefined') {
processed.confirmedAt = data.confirmedAt;
}
const otherProperties = [
'id', 'contributorId', 'token', 'amount', 'vetoed', 'ipfsHash',
'expenses', 'pendingTx'
];
otherProperties.forEach(prop => {
processed[prop] = data[prop];
});
return processed;
}