Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): fixes in get-logs and deploy commands #1572

Merged
merged 2 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions yarn-project/aztec-cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,11 @@ async function main() {
);
}

debugLogger(`Input arguments: ${options.args.map((x: any) => `"${x}"`).join(', ')}`);
const args = encodeArgs(options.args, constructorAbi!.parameters);
const tx = deployer.deploy(args).send({ contractAddressSalt: salt });
debugLogger(`Encoded arguments: ${args.join(', ')}`);
const tx = deployer.deploy(...args).send({ contractAddressSalt: salt });
debugLogger(`Deploy tx sent with hash ${await tx.getTxHash()}`);
const deployed = await tx.wait();
log(`\nContract deployed at ${deployed.contractAddress!.toString()}\n`);
});
Expand Down Expand Up @@ -240,7 +243,7 @@ async function main() {
.option('-u, --rpc-url <string>', 'URL of the Aztec RPC', AZTEC_RPC_HOST || 'http://localhost:8080')
.action(async options => {
const { from, limit } = options;
const fromBlock = from ? parseInt(from) : 0;
const fromBlock = from ? parseInt(from) : 1;
const limitCount = limit ? parseInt(limit) : 100;

const client = createAztecRpcClient(options.rpcUrl);
Expand Down Expand Up @@ -472,6 +475,7 @@ async function main() {
}

main().catch(err => {
log(`Error thrown: ${err}`);
log(`Error in command execution`);
log(err);
process.exit(1);
});
2 changes: 1 addition & 1 deletion yarn-project/foundation/src/abi/encoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ArgumentEncoder {
} else if (arg instanceof Fr) {
this.flattened.push(arg);
} else {
throw new Error('Argument cannot be serialised to a field');
throw new Error(`Argument "${arg}" for ${name} cannot be serialised to a field`);
}
} else {
throw new Error(`Invalid argument "${arg}" of type ${abiType.kind}`);
Expand Down