Skip to content

Commit

Permalink
Merge pull request #2 from aruokhai/e2e-breaking-change
Browse files Browse the repository at this point in the history
fixed breaking changes
  • Loading branch information
notTanveer authored Oct 9, 2024
2 parents a6d07ef + 6851562 commit a62dcc1
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 77 deletions.
7 changes: 3 additions & 4 deletions e2e/helpers/wallet.helper.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mnemonicToSeedSync } from 'bip39';
import { BIP32Factory } from 'bip32';
import { BIP32Interface, fromSeed } from 'bip32';
import * as ecc from 'tiny-secp256k1';
import {
initEccLib,
Expand All @@ -12,19 +12,18 @@ import {
import { convertToSatoshi } from '@e2e/helpers/common.helper';

initEccLib(ecc);
const bip32 = BIP32Factory(ecc);

export class WalletHelper {
private mnemonic: string;
private seed: Buffer;
private root: any;
private root: BIP32Interface;

constructor(
mnemonic = 'select approve zebra athlete happy whisper parrot will yellow fortune demand father',
) {
this.mnemonic = mnemonic;
this.seed = mnemonicToSeedSync(this.mnemonic);
this.root = bip32.fromSeed(this.seed, networks.regtest);
this.root = fromSeed(this.seed, networks.regtest);
}

getMnemonic(): string {
Expand Down
6 changes: 3 additions & 3 deletions e2e/indexer.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Payment } from 'bitcoinjs-lib';
import { generateScantweak } from '@e2e/helpers/common.helper';
import { convertToSatoshi } from '@e2e/helpers/common.helper';

describe('WalletHelper Integration Tests', () => {
describe('Silent Pay Indexer Tests', () => {
let walletHelper: WalletHelper;
let bitcoinRPCUtil: BitcoinRPCUtil;
let apiHelper: ApiHelper;
Expand Down Expand Up @@ -34,7 +34,7 @@ describe('WalletHelper Integration Tests', () => {
await bitcoinRPCUtil.mineToAddress(6, initialAddress);

utxos = [];
for (let i = 0; i < 8; i++) {
for (let i = 0; i < 6; i++) {
for (let vout = 0; vout < 2; vout++) {
const utxo = await bitcoinRPCUtil.getTxOut(txidList[i], vout);

Expand Down Expand Up @@ -83,7 +83,7 @@ describe('WalletHelper Integration Tests', () => {
expect(foundTx.outputs.length).toBe(1);
const output = foundTx.outputs[0];
expect(output).toBeDefined();
expect(output.value).toEqual(convertToSatoshi(5.99));
expect(output.value).toEqual(convertToSatoshi(5.999));

const taprootPubKeyBuffer = Buffer.from(taprootOutput.pubkey).toString(
'hex',
Expand Down
212 changes: 143 additions & 69 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@types/supertest": "^2.0.11",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"bip32": "^5.0.0-rc.0",
"bip32": "^2.0.0",
"bip39": "^3.1.0",
"bitcoinjs-lib": "^6.1.6-rc.0",
"class-transformer": "^0.5.1",
Expand Down

0 comments on commit a62dcc1

Please sign in to comment.