Files
bch-js/test/unit/slp-ecpair.js
T

29 lines
757 B
JavaScript
Raw Normal View History

import assert from 'assert'
2025-11-16 13:47:24 -08:00
import { createRequire } from 'module'
import BCHJS from '../../src/bch-js.js'
2025-11-16 13:47:24 -08:00
const require = createRequire(import.meta.url)
const fixtures = require('./fixtures/slp/ecpair.json')
let slp
// const SLP = require("../../src/slp/slp")
// const slp = new SLP({ restURL: "http://fakeurl.com/" })
2021-01-02 15:41:12 -08:00
describe('#SLP ECPair', () => {
beforeEach(() => {
const bchjs = new BCHJS()
slp = bchjs.SLP
})
2021-01-02 15:41:12 -08:00
describe('#toSLPAddress', () => {
it('should return slp address for ecpair', async () => {
fixtures.wif.forEach((wif, index) => {
const ecpair = slp.ECPair.fromWIF(wif)
const slpAddr = slp.ECPair.toSLPAddress(ecpair)
assert.equal(slpAddr, fixtures.address[index])
})
})
})
})