fix cmd outputs #33

Merged
0xmuralik merged 6 commits from murali/output into main 2023-03-28 12:30:56 +00:00
4 changed files with 8 additions and 6 deletions
Showing only changes of commit 1de17a40ef - Show all commits

View File

@ -43,7 +43,6 @@ export const handler = async (argv: Arguments) => {
const fee = getGasAndFees(argv, cnsConfig);
const result = await registry.commitBid({ auctionId, commitHash }, privateKey, fee);
console.log(JSON.stringify(result, undefined, 2));
console.log(`\nReveal file: ${revealFilePath}`);
const revealFile = `{"reveal_file":"${revealFilePath}"}`
console.log(argv.verbose ? JSON.stringify(result, undefined, 2)+ JSON.stringify(JSON.parse(revealFile)) : JSON.stringify(JSON.parse(revealFile)));
}

View File

@ -28,5 +28,6 @@ export const handler = async (argv: Arguments) => {
const reveal = fs.readFileSync(path.resolve(filePath));
const result = await registry.revealBid({ auctionId, reveal: reveal.toString('hex') }, privateKey, fee);
console.log(JSON.stringify(result, undefined, 2));
const success = `{"success":${result.code==0}}`
console.log(argv.verbose ? JSON.stringify(result, undefined, 2): JSON.stringify(JSON.parse(success)));
}

View File

@ -24,5 +24,6 @@ export const handler = async (argv: Arguments) => {
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const fee = getGasAndFees(argv, cnsConfig);
const result = await registry.setAuthorityBond({ name, bondId }, privateKey, fee);
console.log(JSON.stringify(result, undefined, 2));
const success = `{"success":${result.code==0}}`
console.log(argv.verbose ? JSON.stringify(result, undefined, 2): JSON.stringify(JSON.parse(success)));
}

View File

@ -31,5 +31,6 @@ export const handler = async (argv: Arguments) => {
const fee = getGasAndFees(argv, cnsConfig);
const result = await registry.reserveAuthority({ name, owner }, privateKey, fee);
console.log(JSON.stringify(result, undefined, 2));
const success = `{"success":${result.code==0}}`
console.log(argv.verbose ? JSON.stringify(result, undefined, 2): JSON.stringify(JSON.parse(success)));
}