From f4634fe692908c778178a393d6d5230b82cc24b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Mon, 20 Jan 2025 15:31:19 -0500 Subject: [PATCH] Add amountSats to expense items closes #248 --- config/seeds.js | 8 ++++---- lib/serializers/expense.js | 4 ++++ scripts/seeds.js | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/config/seeds.js b/config/seeds.js index 751b8da..bb6afcb 100644 --- a/config/seeds.js +++ b/config/seeds.js @@ -70,16 +70,16 @@ const contractCalls = [ }, { gasLimit: 350000 }]], ['Reimbursement', 'add', [{ amount: 346800, recipientId: 2, token: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', expenses: [ - { title: 'Domain kosmos.social', description: 'Yearly registration fee for domain kosmos.social', amount: 69.00, currency: 'EUR', date: '2020-04-30' }, + { title: 'Domain kosmos.social', description: 'Yearly registration fee for domain kosmos.social', amount: 69.00, currency: 'EUR', amountSats: 69216, date: '2020-04-30' }, ], confirmedAtBlock: 1 }, { gasLimit: 300000 }]], ['Reimbursement', 'add', [{ amount: 1116000, recipientId: 1, token: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', expenses: [ - { title: 'Server rent', description: 'Dedicated server: andromeda.kosmos.org, April 2020', amount: 61, currency: 'EUR', date: '2020-05-28' }, - { title: 'Server rent', description: 'Dedicated server: centaurus.kosmos.org, April 2020', amount: 32, currency: 'EUR', date: '2020-05-28' }, + { title: 'Server rent', description: 'Dedicated server: andromeda.kosmos.org, April 2020', amount: 61, currency: 'EUR', amountSats: 61191, date: '2020-05-28' }, + { title: 'Server rent', description: 'Dedicated server: centaurus.kosmos.org, April 2020', amount: 32, currency: 'EUR', amountSats: 32201, date: '2020-05-28' }, ], confirmedAtBlock: 1 }, { gasLimit: 300000 }]], ['Reimbursement', 'add', [{ amount: 166800, recipientId: 2, token: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', expenses: [ - { title: 'Domain kosmos.chat', description: 'Yearly registration fee for domain kosmos.chat', amount: 13.90, currency: 'EUR', date: '2020-05-30' }, + { title: 'Domain kosmos.chat', description: 'Yearly registration fee for domain kosmos.chat', amount: 13.90, currency: 'EUR', amountSats: 13944, date: '2020-05-30' }, ]}, { gasLimit: 300000 }]], ]; diff --git a/lib/serializers/expense.js b/lib/serializers/expense.js index 9c1dbf9..85e39b0 100644 --- a/lib/serializers/expense.js +++ b/lib/serializers/expense.js @@ -29,6 +29,7 @@ class ExpenseSerializer { description, currency, amount, + amountSats, date, url, tags, @@ -42,6 +43,7 @@ class ExpenseSerializer { description, currency, amount, + amountSats, date, 'tags': tags || [], 'details': details || {}, @@ -76,6 +78,7 @@ class ExpenseSerializer { description, currency, amount, + amountSats, date, url, tags, @@ -87,6 +90,7 @@ class ExpenseSerializer { description, currency, amount, + amountSats, date, url, tags, diff --git a/scripts/seeds.js b/scripts/seeds.js index a684328..772d49e 100644 --- a/scripts/seeds.js +++ b/scripts/seeds.js @@ -39,7 +39,7 @@ async function main() { contractWrapper.contract[method]; try { - // console.log('trying', func); + // console.log('trying', contractName, method, args); const result = await func.apply(contractWrapper, args); // console.log('result:', result); await result.wait();