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 @@ -211,7 +211,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(); @@ -244,7 +243,6 @@ ); const changeAddress = wallet.Path1899.cashAddress; const outputObj = generateTxOutput( - BCH, isOneToMany, singleSendValue, satoshisToSendOutput, @@ -267,7 +265,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(); @@ -310,7 +307,6 @@ destinationAddressAndValueArray = validAddressArrayInput; const changeAddress = wallet.Path1899.cashAddress; const outputObj = generateTxOutput( - BCH, isOneToMany, singleSendValue, satoshisToSendOutput, @@ -840,7 +836,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( @@ -860,7 +855,6 @@ const changeAddress = wallet.Path1899.cashAddress; const outputObj = generateTxOutput( - BCH, isOneToMany, singleSendValue, satoshisToSend, @@ -878,7 +872,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; @@ -905,7 +898,6 @@ const changeAddress = wallet.Path1899.cashAddress; const outputObj = generateTxOutput( - BCH, isOneToMany, singleSendValue, satoshisToSend, @@ -923,7 +915,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 @@ -941,7 +932,6 @@ let thrownError; try { generateTxOutput( - BCH, isOneToMany, singleSendValue, satoshisToSend, @@ -960,7 +950,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; @@ -988,7 +977,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 ||