diff --git a/web/cashtab/src/hooks/useBCH.js b/web/cashtab/src/hooks/useBCH.js --- a/web/cashtab/src/hooks/useBCH.js +++ b/web/cashtab/src/hooks/useBCH.js @@ -473,7 +473,6 @@ // generate the tx outputs and add to txBuilder instance // returns the updated txBuilder const txOutputObj = generateTxOutput( - BCH, isOneToMany, value, satoshisToSend, diff --git a/web/cashtab/src/utils/__tests__/cashMethods.test.js b/web/cashtab/src/utils/__tests__/cashMethods.test.js --- a/web/cashtab/src/utils/__tests__/cashMethods.test.js +++ b/web/cashtab/src/utils/__tests__/cashMethods.test.js @@ -214,7 +214,6 @@ }); it(`signUtxosByAddress() successfully returns a txBuilder object for a one to one XEC tx`, () => { - const BCH = new BCHJS(); const isOneToMany = false; const { destinationAddress, wallet, utxos } = sendBCHMock; let txBuilder = new TransactionBuilder(); @@ -247,7 +246,6 @@ ); const changeAddress = wallet.Path1899.cashAddress; const outputObj = generateTxOutput( - BCH, isOneToMany, singleSendValue, satoshisToSendOutput, @@ -270,7 +268,6 @@ }); it(`signUtxosByAddress() successfully returns a txBuilder object for a one to many XEC tx`, () => { - const BCH = new BCHJS(); const isOneToMany = true; const { wallet, utxos } = sendBCHMock; let txBuilder = new TransactionBuilder(); @@ -313,7 +310,6 @@ destinationAddressAndValueArray = validAddressArrayInput; const changeAddress = wallet.Path1899.cashAddress; const outputObj = generateTxOutput( - BCH, isOneToMany, singleSendValue, satoshisToSendOutput, @@ -843,7 +839,6 @@ it(`generateTxOutput() returns a txBuilder instance for a valid one to one XEC tx`, () => { // txbuilder output params - const BCH = new BCHJS(); const { destinationAddress, wallet } = sendBCHMock; const isOneToMany = false; const singleSendValue = fromSatoshisToXec( @@ -863,7 +858,6 @@ const changeAddress = wallet.Path1899.cashAddress; const outputObj = generateTxOutput( - BCH, isOneToMany, singleSendValue, satoshisToSend, @@ -881,7 +875,6 @@ it(`generateTxOutput() returns a txBuilder instance for a valid one to many XEC tx`, () => { // txbuilder output params - const BCH = new BCHJS(); const { destinationAddress, wallet } = sendBCHMock; const isOneToMany = true; const singleSendValue = null; @@ -908,7 +901,6 @@ const changeAddress = wallet.Path1899.cashAddress; const outputObj = generateTxOutput( - BCH, isOneToMany, singleSendValue, satoshisToSend, @@ -926,7 +918,6 @@ it(`generateTxOutput() throws an error on invalid input params for a one to one XEC tx`, () => { // txbuilder output params - const BCH = new BCHJS(); const { wallet } = sendBCHMock; const isOneToMany = false; const singleSendValue = null; // invalid due to singleSendValue being mandatory when isOneToMany is false @@ -944,7 +935,6 @@ let thrownError; try { generateTxOutput( - BCH, isOneToMany, singleSendValue, satoshisToSend, @@ -963,7 +953,6 @@ it(`generateTxOutput() throws an error on invalid input params for a one to many XEC tx`, () => { // txbuilder output params - const BCH = new BCHJS(); const { wallet } = sendBCHMock; const isOneToMany = true; const singleSendValue = null; @@ -991,7 +980,6 @@ let thrownError; try { generateTxOutput( - BCH, isOneToMany, singleSendValue, satoshisToSend, diff --git a/web/cashtab/src/utils/__tests__/txBuilder.test.js b/web/cashtab/src/utils/__tests__/txBuilder.test.js --- a/web/cashtab/src/utils/__tests__/txBuilder.test.js +++ b/web/cashtab/src/utils/__tests__/txBuilder.test.js @@ -37,7 +37,6 @@ // verify txBuilder after adding tx outputs txBuilder = generateTxOutput( - BCH, isOneToMany, new BigNumber(6), // XEC denomination of 600 satoshisToSend satoshisToSend, diff --git a/web/cashtab/src/utils/cashMethods.js b/web/cashtab/src/utils/cashMethods.js --- a/web/cashtab/src/utils/cashMethods.js +++ b/web/cashtab/src/utils/cashMethods.js @@ -628,7 +628,6 @@ }; export const generateTxOutput = ( - BCH, isOneToMany, singleSendValue, satoshisToSend, @@ -641,7 +640,6 @@ ) => { try { if ( - !BCH || (isOneToMany && !destinationAddressAndValueArray) || (!isOneToMany && !destinationAddress && !singleSendValue) || !changeAddress ||