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 4, 2023
1 parent 8d12182 commit 395b058
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 @@ -87,13 +87,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 395b058

Please sign in to comment.