mirror of
https://github.com/Permissionless-Software-Foundation/bch-js.git
synced 2026-09-23 01:22:01 -07:00
27 lines
678 B
JavaScript
27 lines
678 B
JavaScript
const assert = require("assert")
|
|
|
|
const fixtures = require("./fixtures/slp/ecpair.json")
|
|
|
|
const BCHJS = require("../../src/bch-js")
|
|
let slp
|
|
|
|
// const SLP = require("../../src/slp/slp")
|
|
// const slp = new SLP({ restURL: "http://fakeurl.com/" })
|
|
|
|
describe("#SLP ECPair", () => {
|
|
beforeEach(() => {
|
|
const bchjs = new BCHJS()
|
|
slp = bchjs.SLP
|
|
})
|
|
|
|
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])
|
|
})
|
|
})
|
|
})
|
|
})
|