mirror of
https://github.com/Permissionless-Software-Foundation/bch-js.git
synced 2026-09-21 16:51:59 -07:00
fix(lint): Fixing linting issue
This commit is contained in:
Generated
+531
-646
File diff suppressed because it is too large
Load Diff
+11
-1
@@ -69,10 +69,20 @@
|
||||
"nyc": "15.1.0",
|
||||
"semantic-release": "19.0.5",
|
||||
"sinon": "9.2.2",
|
||||
"standard": "16.0.4"
|
||||
"standard": "17.1.2"
|
||||
},
|
||||
"apidoc": {
|
||||
"title": "bch-js",
|
||||
"url": "bchjs."
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "npm run lint"
|
||||
}
|
||||
},
|
||||
"standard": {
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "latest"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -312,28 +312,28 @@ class Address {
|
||||
return {
|
||||
prefix: 'bitcoincash',
|
||||
type: 'P2PKH',
|
||||
hash: hash,
|
||||
hash,
|
||||
format: 'legacy'
|
||||
}
|
||||
case info.main.versions.scripthash:
|
||||
return {
|
||||
prefix: 'bitcoincash',
|
||||
type: 'P2SH',
|
||||
hash: hash,
|
||||
hash,
|
||||
format: 'legacy'
|
||||
}
|
||||
case info.test.versions.public:
|
||||
return {
|
||||
prefix: 'bchtest',
|
||||
type: 'P2PKH',
|
||||
hash: hash,
|
||||
hash,
|
||||
format: 'legacy'
|
||||
}
|
||||
case info.test.versions.scripthash:
|
||||
return {
|
||||
prefix: 'bchtest',
|
||||
type: 'P2SH',
|
||||
hash: hash,
|
||||
hash,
|
||||
format: 'legacy'
|
||||
}
|
||||
default:
|
||||
|
||||
+3
-3
@@ -288,7 +288,7 @@ class Blockchain {
|
||||
`${this.restURL}blockchain/getBlockHeader`,
|
||||
{
|
||||
hashes: hash,
|
||||
verbose: verbose
|
||||
verbose
|
||||
},
|
||||
this.axiosOptions
|
||||
)
|
||||
@@ -644,7 +644,7 @@ class Blockchain {
|
||||
const response = await axios.post(
|
||||
`${this.restURL}blockchain/getTxOut`,
|
||||
{
|
||||
txid: txid,
|
||||
txid,
|
||||
vout: n,
|
||||
mempool: includeMempool
|
||||
},
|
||||
@@ -710,7 +710,7 @@ class Blockchain {
|
||||
const response = await axios.post(
|
||||
`${this.restURL}blockchain/getTxOutProof`,
|
||||
{
|
||||
txids: txids
|
||||
txids
|
||||
},
|
||||
this.axiosOptions
|
||||
)
|
||||
|
||||
+2
-5
@@ -1,6 +1,3 @@
|
||||
/* eslint no-prototype-builtins: "off" */
|
||||
/* eslint node/no-callback-literal: "off" */
|
||||
|
||||
import BIP39 from 'bip39'
|
||||
import randomBytes from 'randombytes'
|
||||
import Bitcoin from '@psf/bitcoincashjs-lib'
|
||||
@@ -356,7 +353,7 @@ const _extend = function (dst) {
|
||||
const sources = Array.prototype.slice.call(arguments, 1)
|
||||
for (let i = 0; i < sources.length; ++i) {
|
||||
const src = sources[i]
|
||||
for (const p in src) if (src.hasOwnProperty(p)) dst[p] = src[p]
|
||||
for (const p in src) if (Object.prototype.hasOwnProperty.call(src, p)) dst[p] = src[p]
|
||||
}
|
||||
return dst
|
||||
}
|
||||
@@ -503,7 +500,7 @@ const Levenshtein = {
|
||||
try {
|
||||
options.progress.call(null, (i * 100.0) / str1.length)
|
||||
} catch (err) {
|
||||
return cb(`Progress callback: ${err.toString()}`)
|
||||
return cb(new Error(`Progress callback: ${err.toString()}`))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@ class RawTransactions {
|
||||
url: `${this.restURL}rawtransactions/getRawTransaction`,
|
||||
data: {
|
||||
txids: txid,
|
||||
verbose: verbose,
|
||||
verbose,
|
||||
usrObj // pass user data when making an internal call.
|
||||
},
|
||||
headers: this.axiosOptions.headers
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
import Bitcoin from '@psf/bitcoincashjs-lib'
|
||||
/* eslint-disable */
|
||||
import opcodes from '@psf/bitcoincash-ops' with { type: 'json' }
|
||||
/* eslint-enable */
|
||||
import { createRequire } from 'module'
|
||||
const require = createRequire(import.meta.url)
|
||||
const opcodes = require('@psf/bitcoincash-ops')
|
||||
|
||||
class Script {
|
||||
constructor () {
|
||||
|
||||
@@ -32,9 +32,9 @@ async function loadDependencies () {
|
||||
// const BITBOX = new BITBOXSDK({ restURL: "http://localhost:3000/v2/" })
|
||||
|
||||
try {
|
||||
/* eslint-disable */
|
||||
walletInfo = (await import('./wallet.json', { with: { type: 'json' } })).default
|
||||
/* eslint-enable */
|
||||
const { createRequire } = await import('module')
|
||||
const require = createRequire(import.meta.url)
|
||||
walletInfo = require('./wallet.json')
|
||||
} catch (err) {
|
||||
console.log(
|
||||
'Could not open wallet.json. Generate a wallet with create-wallet first.'
|
||||
|
||||
@@ -31,9 +31,9 @@ async function loadDependencies () {
|
||||
// const BITBOX = new BITBOXSDK({ restURL: "http://localhost:3000/v2/" })
|
||||
|
||||
try {
|
||||
/* eslint-disable */
|
||||
walletInfo = (await import('./wallet.json', { with: { type: 'json' } })).default
|
||||
/* eslint-enable */
|
||||
const { createRequire } = await import('module')
|
||||
const require = createRequire(import.meta.url)
|
||||
walletInfo = require('./wallet.json')
|
||||
} catch (err) {
|
||||
console.log(
|
||||
'Could not open wallet.json. Generate a wallet with create-wallet first.'
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
tests.
|
||||
*/
|
||||
|
||||
import SLPSDK from '../../../lib/SLP.js'
|
||||
|
||||
export default {
|
||||
openWallet,
|
||||
sendToken,
|
||||
getTestTokenBalance,
|
||||
threeDecimals
|
||||
}
|
||||
|
||||
import SLPSDK from '../../../lib/SLP.js'
|
||||
const slpsdk = new SLPSDK()
|
||||
|
||||
const testTokenId =
|
||||
@@ -20,11 +20,10 @@ const testTokenId =
|
||||
// token balance.
|
||||
async function openWallet (filename) {
|
||||
try {
|
||||
// Note: Dynamic imports for JSON files - use createRequire or import with assert
|
||||
// For ESM, we need to handle dynamic JSON imports differently
|
||||
/* eslint-disable */
|
||||
const walletInfo = await import(filename, { with: { type: 'json' } }).then(m => m.default)
|
||||
/* eslint-enable */
|
||||
// Note: Dynamic imports for JSON files - use createRequire
|
||||
const { createRequire } = await import('module')
|
||||
const require = createRequire(import.meta.url)
|
||||
const walletInfo = require(filename)
|
||||
|
||||
// const walletBalance = await getBalance(walletInfo)
|
||||
// const walletBalance = await slpsdk.Utils.balancesForAddress(
|
||||
|
||||
@@ -4,12 +4,12 @@ import assert from 'assert'
|
||||
import Bitcoin from '@psf/bitcoincashjs-lib'
|
||||
|
||||
// Mocks
|
||||
/* eslint-disable */
|
||||
import fixtures from './fixtures/address.json' with { type: 'json' }
|
||||
/* eslint-enable */
|
||||
import { createRequire } from 'module'
|
||||
|
||||
// Unit under test (uut)
|
||||
import BCHJS from '../../src/bch-js.js'
|
||||
const require = createRequire(import.meta.url)
|
||||
const fixtures = require('./fixtures/address.json')
|
||||
let bchjs
|
||||
|
||||
function flatten (arrays) {
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
import assert from 'assert'
|
||||
|
||||
// Mocks
|
||||
/* eslint-disable */
|
||||
import fixtures from './fixtures/bitcoincash.json' with { type: 'json' }
|
||||
/* eslint-enable */
|
||||
import { createRequire } from 'module'
|
||||
|
||||
// Unit under test (uut)
|
||||
import BCHJS from '../../src/bch-js.js'
|
||||
const require = createRequire(import.meta.url)
|
||||
const fixtures = require('./fixtures/bitcoincash.json')
|
||||
// const bchjs = new BCHJS()
|
||||
let bchjs
|
||||
|
||||
|
||||
+15
-15
@@ -61,7 +61,7 @@ describe('#Blockchain', () => {
|
||||
}
|
||||
|
||||
it('should get block by hash', done => {
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'post').returns(resolved)
|
||||
|
||||
const blockhash =
|
||||
@@ -130,7 +130,7 @@ describe('#Blockchain', () => {
|
||||
}
|
||||
|
||||
it('should get blockchain info', done => {
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.Blockchain.getBlockchainInfo()
|
||||
@@ -148,7 +148,7 @@ describe('#Blockchain', () => {
|
||||
const data = 527810
|
||||
|
||||
it('should get block count', done => {
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.Blockchain.getBlockCount()
|
||||
@@ -167,7 +167,7 @@ describe('#Blockchain', () => {
|
||||
'000000000000000001d127592d091d4c45062504663c9acab27a1b16c028e3c0'
|
||||
|
||||
it('should get block hash by height', done => {
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.Blockchain.getBlockHash(527810)
|
||||
@@ -202,7 +202,7 @@ describe('#Blockchain', () => {
|
||||
}
|
||||
|
||||
it('should get block header by hash', done => {
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.Blockchain.getBlockHeader(
|
||||
@@ -223,7 +223,7 @@ describe('#Blockchain', () => {
|
||||
const data = '577528469277.1339'
|
||||
|
||||
it('should get difficulty', done => {
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.Blockchain.getDifficulty()
|
||||
@@ -241,7 +241,7 @@ describe('#Blockchain', () => {
|
||||
const data = 'Transaction not in mempool'
|
||||
|
||||
it('should get mempool ancestors', done => {
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.Blockchain.getMempoolAncestors(
|
||||
@@ -264,7 +264,7 @@ describe('#Blockchain', () => {
|
||||
}
|
||||
|
||||
it('should get mempool descendants', done => {
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.Blockchain.getMempoolDescendants(
|
||||
@@ -287,7 +287,7 @@ describe('#Blockchain', () => {
|
||||
}
|
||||
|
||||
it('should get mempool entry', done => {
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.Blockchain.getMempoolEntry(
|
||||
@@ -315,7 +315,7 @@ describe('#Blockchain', () => {
|
||||
}
|
||||
|
||||
it('should get mempool info', done => {
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.Blockchain.getMempoolInfo()
|
||||
@@ -356,7 +356,7 @@ describe('#Blockchain', () => {
|
||||
}
|
||||
|
||||
it('should get mempool info', done => {
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.Blockchain.getRawMempool()
|
||||
@@ -452,7 +452,7 @@ describe('#Blockchain', () => {
|
||||
}
|
||||
|
||||
it('should get TODO', done => {
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.Blockchain.preciousBlock()
|
||||
@@ -470,7 +470,7 @@ describe('#Blockchain', () => {
|
||||
const data = 'Cannot prune blocks because node is not in prune mode.'
|
||||
|
||||
it('should prune blockchain', done => {
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'post').returns(resolved)
|
||||
|
||||
bchjs.Blockchain.pruneBlockchain(507)
|
||||
@@ -488,7 +488,7 @@ describe('#Blockchain', () => {
|
||||
const data = true
|
||||
|
||||
it('should verify blockchain', done => {
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.Blockchain.verifyChain(3, 6)
|
||||
@@ -506,7 +506,7 @@ describe('#Blockchain', () => {
|
||||
const data = "proof must be hexadecimal string (not '')"
|
||||
|
||||
it('should verify utxo proof', done => {
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.Blockchain.verifyTxOutProof('3')
|
||||
|
||||
@@ -24,7 +24,7 @@ describe('#Control', () => {
|
||||
relayfee: 0.00001,
|
||||
errors: ''
|
||||
}
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.Control.getNetworkInfo()
|
||||
@@ -47,7 +47,7 @@ describe('#Control', () => {
|
||||
chunks_free: 1
|
||||
}
|
||||
}
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.Control.getMemoryInfo()
|
||||
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
/* eslint-disable */
|
||||
import fixtures from './fixtures/crypto.json' with { type: 'json' }
|
||||
/* eslint-enable */
|
||||
import { createRequire } from 'module'
|
||||
import assert from 'assert'
|
||||
import BCHJS from '../../src/bch-js.js'
|
||||
const bchjs = new BCHJS()
|
||||
import { Buffer } from 'safe-buffer'
|
||||
const require = createRequire(import.meta.url)
|
||||
const fixtures = require('./fixtures/crypto.json')
|
||||
const bchjs = new BCHJS()
|
||||
|
||||
describe('#Crypto', () => {
|
||||
describe('#sha256', () => {
|
||||
|
||||
@@ -3,12 +3,12 @@ import assert from 'assert'
|
||||
import { Buffer } from 'safe-buffer'
|
||||
|
||||
// Mocks
|
||||
/* eslint-disable */
|
||||
import fixtures from './fixtures/ecpair.json' with { type: 'json' }
|
||||
/* eslint-enable */
|
||||
import { createRequire } from 'module'
|
||||
|
||||
// Unit under test (uut)
|
||||
import BCHJS from '../../src/bch-js.js'
|
||||
const require = createRequire(import.meta.url)
|
||||
const fixtures = require('./fixtures/ecpair.json')
|
||||
// const bchjs = new BCHJS()
|
||||
let bchjs
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ describe('#Generating', () => {
|
||||
|
||||
it('should generate', done => {
|
||||
const data = []
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'post').returns(resolved)
|
||||
|
||||
bchjs.Generating.generateToAddress(
|
||||
|
||||
+4
-4
@@ -3,13 +3,13 @@ import assert from 'assert'
|
||||
import { Buffer } from 'safe-buffer'
|
||||
|
||||
// Mocks
|
||||
/* eslint-disable */
|
||||
import fixtures from './fixtures/hdnode.json' with { type: 'json' }
|
||||
/* eslint-enable */
|
||||
// import slpFixtures from './fixtures/slp/address.json' with { type: 'json' }
|
||||
import { createRequire } from 'module'
|
||||
// const slpFixtures = require('./fixtures/slp/address.json')
|
||||
|
||||
// Unit under test (uut)
|
||||
import BCHJS from '../../src/bch-js.js'
|
||||
const require = createRequire(import.meta.url)
|
||||
const fixtures = require('./fixtures/hdnode.json')
|
||||
let bchjs
|
||||
|
||||
describe('#HDNode', () => {
|
||||
|
||||
+4
-4
@@ -30,7 +30,7 @@ describe('#Mining', () => {
|
||||
sigops: 2
|
||||
}
|
||||
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.Mining.getBlockTemplate('')
|
||||
@@ -59,7 +59,7 @@ describe('#Mining', () => {
|
||||
chain: 'main'
|
||||
}
|
||||
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.Mining.getMiningInfo()
|
||||
@@ -78,7 +78,7 @@ describe('#Mining', () => {
|
||||
it('should get network hashps', done => {
|
||||
const data = 3586365937646890000
|
||||
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.Mining.getNetworkHashps()
|
||||
@@ -98,7 +98,7 @@ describe('#Mining', () => {
|
||||
it('should TODO', done => {
|
||||
const data = {}
|
||||
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'post').returns(resolved)
|
||||
|
||||
bchjs.Mining.submitBlock()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* eslint-disable */
|
||||
import fixtures from './fixtures/mnemonic.json' with { type: 'json' }
|
||||
/* eslint-enable */
|
||||
import { createRequire } from 'module'
|
||||
import assert from 'assert'
|
||||
import BCHJS from '../../src/bch-js.js'
|
||||
const require = createRequire(import.meta.url)
|
||||
const fixtures = require('./fixtures/mnemonic.json')
|
||||
const bchjs = new BCHJS()
|
||||
|
||||
describe('#Mnemonic', () => {
|
||||
|
||||
@@ -45,7 +45,7 @@ describe('#RawTransactions', () => {
|
||||
vout: []
|
||||
}
|
||||
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.RawTransactions.decodeRawTransaction('02000000000000000000')
|
||||
@@ -68,7 +68,7 @@ describe('#RawTransactions', () => {
|
||||
p2sh: 'bitcoincash:prswx5965nfumux9qng5kj8hw603vcne7q08t8c6jp'
|
||||
}
|
||||
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
const result = await bchjs.RawTransactions.decodeScript(
|
||||
@@ -89,7 +89,7 @@ describe('#RawTransactions', () => {
|
||||
const data =
|
||||
'020000000160d663961c63c7f0a07f22ec07b8f55b3935bfdbed8b1d8454916e8932fbf109010000006b4830450221008479fab4cfdcb111833d250a43f98ac26d43272b7a29cb1b9a0491eae5c44b3502203448b17253632395c29a7d62058bbfe93efb20fc8636ba6837002d464195aec04121029123258f7cdcd45b864066bcaa9b71f24d5ed1fa1dd36eaf107d8432b5014658ffffffff016d180000000000001976a91479d3297d1823149f4ec61df31d19f2fad5390c0288ac00000000'
|
||||
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.RawTransactions.getRawTransaction(
|
||||
@@ -110,7 +110,7 @@ describe('#RawTransactions', () => {
|
||||
it('should send single raw transaction', async () => {
|
||||
const data = 'Error: transaction already in block chain'
|
||||
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
const result = await bchjs.RawTransactions.sendRawTransaction(
|
||||
|
||||
@@ -3,12 +3,12 @@ import assert from 'assert'
|
||||
import { Buffer } from 'safe-buffer'
|
||||
|
||||
// Mocks
|
||||
/* eslint-disable */
|
||||
import fixtures from './fixtures/script.json' with { type: 'json' }
|
||||
/* eslint-enable */
|
||||
import { createRequire } from 'module'
|
||||
|
||||
// Unit under test (uut)
|
||||
import BCHJS from '../../src/bch-js.js'
|
||||
const require = createRequire(import.meta.url)
|
||||
const fixtures = require('./fixtures/script.json')
|
||||
let bchjs
|
||||
|
||||
describe('#Script', () => {
|
||||
@@ -440,8 +440,8 @@ describe('#Script', () => {
|
||||
Buffer.from(fixture.hex, 'hex')
|
||||
),
|
||||
{
|
||||
redeemScriptSig: redeemScriptSig,
|
||||
redeemScript: redeemScript
|
||||
redeemScriptSig,
|
||||
redeemScript
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import assert from 'assert'
|
||||
|
||||
import BCHJS from '../../src/bch-js.js'
|
||||
|
||||
import { createRequire } from 'module'
|
||||
// import SLP from "../../src/slp/slp.js"
|
||||
// const SLP = new slp({ restURL: "http://fakeurl.com/" })
|
||||
let slp
|
||||
|
||||
/* eslint-disable */
|
||||
import fixtures from './fixtures/slp/address.json' with { type: 'json' }
|
||||
/* eslint-enable */
|
||||
const require = createRequire(import.meta.url)
|
||||
const fixtures = require('./fixtures/slp/address.json')
|
||||
// const axios = require("axios")
|
||||
// const sinon = require("sinon")
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import assert from 'assert'
|
||||
|
||||
/* eslint-disable */
|
||||
import fixtures from './fixtures/slp/ecpair.json' with { type: 'json' }
|
||||
/* eslint-enable */
|
||||
import { createRequire } from 'module'
|
||||
|
||||
import BCHJS from '../../src/bch-js.js'
|
||||
const require = createRequire(import.meta.url)
|
||||
const fixtures = require('./fixtures/slp/ecpair.json')
|
||||
let slp
|
||||
|
||||
// const SLP = require("../../src/slp/slp")
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/* eslint-disable */
|
||||
import fixtures from './fixtures/transaction-builder.json' with { type: 'json' }
|
||||
/* eslint-enable */
|
||||
import { createRequire } from 'module'
|
||||
import assert from 'assert'
|
||||
import chai from 'chai'
|
||||
const { assert: assert2 } = chai
|
||||
import BCHJS from '../../src/bch-js.js'
|
||||
const bchjs = new BCHJS()
|
||||
import { Buffer } from 'safe-buffer'
|
||||
const require = createRequire(import.meta.url)
|
||||
const fixtures = require('./fixtures/transaction-builder.json')
|
||||
const { assert: assert2 } = chai
|
||||
const bchjs = new BCHJS()
|
||||
|
||||
describe('#TransactionBuilder', () => {
|
||||
describe('#hashTypes', () => {
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ describe('#Util', () => {
|
||||
isscript: false
|
||||
}
|
||||
|
||||
const resolved = new Promise(resolve => resolve({ data: data }))
|
||||
const resolved = new Promise(resolve => resolve({ data }))
|
||||
sandbox.stub(axios, 'get').returns(resolved)
|
||||
|
||||
bchjs.Util.validateAddress(
|
||||
|
||||
Reference in New Issue
Block a user