parseNote command

This commit is contained in:
gozzy 2023-02-19 00:01:25 +00:00
parent b719843d50
commit cdee9c12fb

15
cli.js

@ -1488,6 +1488,21 @@ async function main() {
const cachedEvents = await fetchEvents({ type, currency, amount });
console.log("Synced event for", type, amount, currency.toUpperCase(), netName, "Tornado instance to block", cachedEvents[cachedEvents.length - 1].blockNumber);
});
program
.command('parseNote <note>')
.action(async(noteString) => {
const parse = parseNote(noteString);
netId = parse.netId;
netName = getCurrentNetworkName();
console.log('\n=============Note=================');
console.log('Network:', netName);
console.log('Denomination:', parse.amount, parse.currency.toUpperCase());
console.log('Commitment: ', parse.deposit.commitmentHex);
console.log('Nullifier Hash: ', parse.deposit.nullifierHex);
console.log('=====================================', '\n');
})
program
.command('test')
.description('Perform an automated test. It deposits and withdraws one ETH and one ERC20 note. Uses ganache.')