Skip to content

Commit

Permalink
fix(account): show network id in sign call output
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuk committed Apr 1, 2023
1 parent 27175fc commit 836f421
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/actions/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@ export async function sign(walletPath, tx, options) {

const signedTx = await account.signTransaction(tx);
const address = await account.address();
const networkId = account.getNetworkId();
const networkId = await account.getNetworkId();
if (json) {
print({ signedTx, address, networkId });
} else {
printUnderscored('Signing account address', address);
printUnderscored('Network ID', networkId);
// TODO: remove unsigned tx because it is already accepted in arguments
printUnderscored('Unsigned', tx);
printUnderscored('Signed', signedTx);
}
Expand Down
4 changes: 2 additions & 2 deletions test/tx.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ This is an unsigned transaction. Use \`account sign\` and \`tx broadcast\` to su
expect(responseJson.signedTx).to.satisfy((s) => s.startsWith(Encoding.Transaction));
expect(responseJson).to.eql({
address: TX_KEYS.publicKey,
networkId: {},
networkId: 'ae_devnet',
signedTx: responseJson.signedTx,
});

const response = await executeProgram(accountProgram, args);
expect(response).to.equal(`
Signing account address _________________ ${TX_KEYS.publicKey}
Network ID ______________________________ {}
Network ID ______________________________ ae_devnet
Unsigned ________________________________ ${tx}
Signed __________________________________ ${responseJson.signedTx}
`.trim());
Expand Down

0 comments on commit 836f421

Please sign in to comment.