diff --git a/package.json b/package.json index c6d59b5..c878d35 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "test:integration:local:abc": "export RESTURL=http://localhost:3000/v5/ && mocha --timeout 30000 test/integration && mocha --timeout 30000 test/integration/chains/abc/", "test:integration:local:bchn": "export RESTURL=http://localhost:3000/v5/ && mocha --timeout 30000 test/integration/ && mocha --timeout 30000 test/integration/chains/bchn/", "test:integration:local:testnet": "RESTURL=http://localhost:4000/v5/ mocha --timeout 30000 test/integration/chains/testnet", - "test:integration:decatur:bchn": "export RESTURL=http://192.168.2.139:3000/v5/ && mocha --timeout 30000 test/integration/ && mocha --timeout 30000 test/integration/chains/bchn/", + "test:integration:decatur:bchn": "export RESTURL=http://192.168.2.129:3000/v5/ && mocha --timeout 30000 test/integration/ && mocha --timeout 30000 test/integration/chains/bchn/", "test:integration:decatur:abc": "export RESTURL=http://192.168.2.141:3000/v5/ && mocha --timeout 30000 test/integration && mocha --timeout 30000 test/integration/chains/abc/", "test:integration:temp:bchn": "export RESTURL=http://157.90.174.219:3000/v5/ && mocha --timeout 30000 test/integration/", "test:temp": "export RESTURL=http://localhost:3000/v5/ && mocha --timeout 30000 -g '#Encryption' test/integration/", diff --git a/test/integration/chains/abc/utxo-integration.js b/test/integration/chains/abc/utxo-integration.js index c5a2f97..c387c7b 100644 --- a/test/integration/chains/abc/utxo-integration.js +++ b/test/integration/chains/abc/utxo-integration.js @@ -2,10 +2,10 @@ Integration tests for the utxo.js library. */ -const assert = require('chai').assert +// const assert = require('chai').assert -const BCHJS = require('../../../../src/bch-js') -const bchjs = new BCHJS() +// const BCHJS = require('../../../../src/bch-js') +// const bchjs = new BCHJS() describe('#UTXO', () => { beforeEach(async () => { @@ -14,6 +14,7 @@ describe('#UTXO', () => { if (process.env.IS_USING_FREE_TIER) await sleep(1500) }) + /* describe('#get', () => { it('should get hydrated and filtered UTXOs for an address', async () => { // const addr = 'bitcoincash:qqh793x9au6ehvh7r2zflzguanlme760wuzehgzjh9' @@ -31,6 +32,7 @@ describe('#UTXO', () => { assert.isArray(result[0].nullUtxos) }) }) + */ }) function sleep (ms) { diff --git a/test/integration/chains/bchn/transaction-integration.js b/test/integration/chains/bchn/transaction-integration.js new file mode 100644 index 0000000..598d824 --- /dev/null +++ b/test/integration/chains/bchn/transaction-integration.js @@ -0,0 +1,28 @@ +/* + Integration tests for the transaction.js library. +*/ + +const assert = require('chai').assert +const BCHJS = require('../../../../src/bch-js') +const bchjs = new BCHJS() + +describe('#Transaction', () => { + beforeEach(async () => { + if (process.env.IS_USING_FREE_TIER) await bchjs.Util.sleep(1000) + }) + + describe('#get', () => { + it('should get a tx details for a non-SLP TX with an OP_RETURN', async () => { + const txid = + '01517ff1587fa5ffe6f5eb91c99cf3f2d22330cd7ee847e928ce90ca95bf781b' + + const result = await bchjs.Transaction.get(txid) + // console.log('result: ', result) + + assert.property(result.txData, 'txid') + assert.property(result.txData, 'vin') + assert.property(result.txData, 'vout') + assert.equal(result.txData.isValidSlp, false) + }) + }) +})