Tornado CLI 1.0.10-alpha

use latest core deps
minor optimization
This commit is contained in:
Tornado Contrib 2024-09-26 12:46:23 +00:00
parent 4c9fc48ad5
commit de6b929c51
Signed by: tornadocontrib
GPG Key ID: 60B4DF1A076C64B1
4 changed files with 22 additions and 31 deletions

24
dist/cli.js vendored

@ -181115,7 +181115,7 @@ function calculateSnarkProof(input, circuit, provingKey) {
;// CONCATENATED MODULE: ./package.json
const package_namespaceObject = /*#__PURE__*/JSON.parse('{"rE":"1.0.9-alpha","h_":"Modern Toolsets for Privacy Pools on Ethereum"}');
const package_namespaceObject = /*#__PURE__*/JSON.parse('{"rE":"1.0.10-alpha","h_":"Modern Toolsets for Privacy Pools on Ethereum"}');
var package_namespaceObject_0 = /*#__PURE__*/__webpack_require__.t(package_namespaceObject, 2);
;// CONCATENATED MODULE: external "module"
const external_module_namespaceObject = require("module");
@ -183919,7 +183919,7 @@ function loadSavedEvents(_0) {
if (!(yield existsAsync(filePath))) {
return {
events: [],
lastBlock: null
lastBlock: deployedBlock
};
}
try {
@ -185110,10 +185110,9 @@ function getProgramOptions(options) {
[{ colSpan: 2, content: "Program Options", hAlign: "center" }],
["IP", ip],
["Is Tor", isTor],
...Object.keys(options).map((key) => {
const value = options[key];
...Object.entries(options).map(([key, value]) => {
if (typeof value !== "undefined") {
return [key, options[key]];
return [key, value];
}
}).filter((r) => r)
);
@ -185261,16 +185260,14 @@ function programSendTransaction(_0) {
}) {
const txTable = new (cli_table3_default())();
const txObject = !populatedTransaction.gasLimit || !populatedTransaction.from ? JSON.parse(JSON.stringify(yield signer.populateTransaction(populatedTransaction))) : JSON.parse(JSON.stringify(populatedTransaction, null, 2));
const txKeys = Object.keys(txObject);
const txValues = Object.values(txObject);
const txType = signer instanceof VoidSigner ? "Unsigned Transaction" : options.localRpc ? "Unbroadcasted Transaction" : "Send Transaction?";
txTable.push(
[{ colSpan: 2, content: txType, hAlign: "center" }],
...txKeys.map((key, index) => {
if (key === "data" && txValues[index]) {
return ["data", substring(txValues[index], 40)];
...Object.entries(txObject).map(([key, value]) => {
if (key === "data" && value) {
return ["data", substring(value, 40)];
}
return [key, txValues[index]];
return [key, value];
})
);
if (txType === "Unsigned Transaction") {
@ -185973,9 +185970,8 @@ function tornadoProgram() {
const currencies = currencyOpts ? [currencyOpts.toLowerCase()] : getActiveTokens(config);
for (const currency of currencies) {
const currencyConfig = tokens[currency];
const amounts = Object.keys(currencyConfig.instanceAddress);
for (const amount of amounts) {
const instanceAddress = currencyConfig.instanceAddress[amount];
const instance = Object.entries(currencyConfig.instanceAddress);
for (const [amount, instanceAddress] of instance) {
const Tornado = Tornado__factory.connect(instanceAddress, provider);
const TornadoServiceConstructor = {
netId,

@ -1,6 +1,6 @@
{
"name": "@tornado/cli",
"version": "1.0.9-alpha",
"version": "1.0.10-alpha",
"description": "Modern Toolsets for Privacy Pools on Ethereum",
"main": "./dist/cli.js",
"types": "./dist/cli.d.ts",
@ -51,7 +51,7 @@
"optionalDependencies": {},
"devDependencies": {
"@colors/colors": "1.5.0",
"@tornado/core": "git+https://git.tornado.ws/tornadocontrib/tornado-core.git#f7fdf7db0a813ae2193f9864e212d68dc840c0d7",
"@tornado/core": "git+https://git.tornado.ws/tornadocontrib/tornado-core.git#c155649719d121fe50799420750f531eb50589ce",
"@typechain/ethers-v6": "^0.5.1",
"@types/figlet": "^1.5.8",
"@typescript-eslint/eslint-plugin": "^8.6.0",

@ -202,12 +202,10 @@ export async function getProgramOptions(options: commonProgramOptions): Promise<
[{ colSpan: 2, content: 'Program Options', hAlign: 'center' }],
['IP', ip],
['Is Tor', isTor],
...(Object.keys(options)
.map((key) => {
const value = (options as unknown as { [key in string]: string })[key];
...(Object.entries(options)
.map(([key, value]) => {
if (typeof value !== 'undefined') {
return [key, (options as unknown as { [key in string]: string })[key]];
return [key, value];
}
})
.filter((r) => r) as string[][]),
@ -409,8 +407,6 @@ export async function programSendTransaction({
? (JSON.parse(JSON.stringify(await signer.populateTransaction(populatedTransaction))) as TransactionLike)
: (JSON.parse(JSON.stringify(populatedTransaction, null, 2)) as TransactionLike);
const txKeys = Object.keys(txObject);
const txValues = Object.values(txObject);
const txType =
signer instanceof VoidSigner
? 'Unsigned Transaction'
@ -420,11 +416,11 @@ export async function programSendTransaction({
txTable.push(
[{ colSpan: 2, content: txType, hAlign: 'center' }],
...txKeys.map((key, index) => {
if (key === 'data' && txValues[index]) {
return ['data', substring(txValues[index], 40)];
...Object.entries(txObject).map(([key, value]) => {
if (key === 'data' && value) {
return ['data', substring(value, 40)];
}
return [key, txValues[index]];
return [key, value];
}),
);
@ -1364,11 +1360,10 @@ export function tornadoProgram() {
for (const currency of currencies) {
const currencyConfig = tokens[currency];
// Now load the denominations and address
const amounts = Object.keys(currencyConfig.instanceAddress);
const instance = Object.entries(currencyConfig.instanceAddress);
// And now sync
for (const amount of amounts) {
const instanceAddress = currencyConfig.instanceAddress[amount];
for (const [amount, instanceAddress] of instance) {
const Tornado = Tornado__factory.connect(instanceAddress, provider);
const TornadoServiceConstructor = {

@ -121,7 +121,7 @@ export async function loadSavedEvents<T extends MinimalEvents>({
if (!(await existsAsync(filePath))) {
return {
events: [] as T[],
lastBlock: null,
lastBlock: deployedBlock,
};
}