Skip to content

Commit

Permalink
Removes peglib from utils.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-then committed Dec 5, 2023
1 parent c83f763 commit a640e2b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
var fs = require('fs-extra');
var utils = require('peglib').utils;
const bitcoin = require('peglib').bitcoin;
const merkleLib = require('merkle-lib');
const pmtBuilder = require('@rsksmart/pmt-builder');
const bitcoinJs = require('bitcoinjs-lib');
@@ -13,7 +12,9 @@ var sequentialPromise = function(n, promiseReturn) {
};

const publicKeyToCompressed = function(publicKey) {
return bitcoin.keys.publicKeyToCompressed(publicKey);
return bitcoinJs.ECPair.fromPublicKey(Buffer.from(publicKey, 'hex'), { compressed: true })
.publicKey
.toString('hex');
}

var mapPromiseAll = function(map) {

0 comments on commit a640e2b

Please sign in to comment.