Skip to content

Commit

Permalink
feat: better error handling in approve flow
Browse files Browse the repository at this point in the history
  • Loading branch information
theblockstalk committed Sep 6, 2024
1 parent f8b9a52 commit c6853b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/cli/msig/hyphaContractSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ export async function hyphaContractSet(args: any, options: StandardProposalOptio

if (!deployActions) throw new Error('Expected deployActions to be defined');

console.log('buyRamAction', buyRamAction);
const actions = [adminSetAppAction, transferTokensAction, buyRamAction, ...deployActions];

const proposalHash = await createProposal(options.proposer, options.proposalName, actions, options.privateKey, [
Expand Down
8 changes: 4 additions & 4 deletions src/cli/msig/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export default async function msig(args: string[]) {
console.error('Transaction succeeded');
} catch (e) {
console.error('Error: ', JSON.stringify(e, null, 2));
console.error('Transaction failed');
throw new Error('Transaction failed');
}
} else if (args[0] === 'exec') {
const proposalName = Name.from(args[1]);
Expand All @@ -251,7 +251,7 @@ export default async function msig(args: string[]) {
console.error('Transaction succeeded');
} catch (e) {
console.error('Error: ', JSON.stringify(e, null, 2));
console.error('Transaction failed');
throw new Error('Transaction failed');
}
} else {
printCliHelp();
Expand Down Expand Up @@ -345,12 +345,12 @@ export async function executeProposal(proposer: string, proposalName: Name, prop

console.log('Proposal approved succeeded');

await eosioMsigContract.exec(proposer, proposalName, governanceAccounts[0], tonomyGovSigners[0]);
await eosioMsigContract.exec(proposer, proposalName, proposer, tonomyGovSigners[0]);

console.log('Proposal executed succeeded');
} catch (e) {
console.error('Error: ', JSON.stringify(e, null, 2));
console.error('Transaction failed');
throw new Error('Transaction failed');
}
}

Expand Down

0 comments on commit c6853b2

Please sign in to comment.