Prettify 'compliance' command output: now deposit and withdrawal events load before compliance info printing

This commit is contained in:
Theo 2023-05-19 22:04:53 +03:00
parent d93603ff1e
commit 0f70b58c78

5
cli.js

@ -1627,7 +1627,10 @@ async function main() {
const { currency, amount, netId, deposit } = parseNote(noteString); const { currency, amount, netId, deposit } = parseNote(noteString);
await init({ rpc: program.rpc, noteNetId: netId, currency, amount }); await init({ rpc: program.rpc, noteNetId: netId, currency, amount });
const depositInfo = await loadDepositData({ amount, currency, deposit }); const depositInfo = await loadDepositData({ amount, currency, deposit });
const withdrawInfo = await loadWithdrawalData({ amount, currency, deposit });
const depositDate = new Date(depositInfo.timestamp * 1000); const depositDate = new Date(depositInfo.timestamp * 1000);
console.log('\n=============Deposit================='); console.log('\n=============Deposit=================');
console.log('Deposit :', amount, currency.toUpperCase()); console.log('Deposit :', amount, currency.toUpperCase());
@ -1641,7 +1644,7 @@ async function main() {
return; return;
} }
console.log('=====================================', '\n'); console.log('=====================================', '\n');
const withdrawInfo = await loadWithdrawalData({ amount, currency, deposit });
const withdrawalDate = new Date(withdrawInfo.timestamp * 1000); const withdrawalDate = new Date(withdrawInfo.timestamp * 1000);
console.log('\n=============Withdrawal=============='); console.log('\n=============Withdrawal==============');
console.log('Withdrawal :', withdrawInfo.amount, currency); console.log('Withdrawal :', withdrawInfo.amount, currency);