Skip to content

Commit

Permalink
refactor: add attribute signTx as false
Browse files Browse the repository at this point in the history
  • Loading branch information
alexruzenhack committed Jul 7, 2023
1 parent 23a6170 commit 651c12e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 5 additions & 0 deletions __tests__/p2sh/tx-proposal-mint-tokens.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ describe('mint-tokens tx-proposal api', () => {
.createTxFromHex(response.body.txHex, new hathorLib.Network('testnet'));
expect(tx.outputs.map(o => o.decodedScript.address.base58))
.toEqual(expect.arrayContaining(['wbe2eJdyZVimA7nJjmBQnKYJSXmpnpMKgG']));
expect(tx.inputs).toEqual(expect.not.arrayContaining([
expect.objectContaining({
data: expect.any(Object),
}),
]));
});

it('should not accept mint token with empty token', async () => {
Expand Down
6 changes: 1 addition & 5 deletions src/controllers/wallet/p2sh/tx-proposal.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,9 @@ async function buildMintTokensTxProposal(req, res) {
createAnotherMint,
mintAuthorityAddress,
allowExternalMintAuthorityAddress,
signTx: false,
}
);
mintTokenTransaction.inputs.map(eachInput => {
const { data, ...input } = eachInput;
return input;
});

res.send({ success: true, txHex: mintTokenTransaction.toHex() });
} catch (err) {
res.send({ success: false, error: err.message });
Expand Down

0 comments on commit 651c12e

Please sign in to comment.