Skip to content

Commit a04b9d5

Browse files
committed
refactor: rename testecc to verifyecc (avoid confusing it with unit tests)
1 parent f5ee927 commit a04b9d5

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

src/payments/p2tr.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const types_1 = require('../types');
88
const taprootutils_1 = require('./taprootutils');
99
const lazy = require('./lazy');
1010
const bech32_1 = require('bech32');
11-
const testecc_1 = require('./testecc');
11+
const verifyecc_1 = require('./verifyecc');
1212
const OPS = bscript.OPS;
1313
const TAPROOT_WITNESS_VERSION = 0x01;
1414
const ANNEX_PREFIX = 0x50;
@@ -25,7 +25,7 @@ function p2tr(a, opts) {
2525
opts = Object.assign({ validate: true }, opts || {});
2626
const _ecc = lazy.value(() => {
2727
if (!opts.eccLib) throw new Error('ECC Library is missing for p2tr.');
28-
(0, testecc_1.testEcc)(opts.eccLib);
28+
(0, verifyecc_1.verifyEcc)(opts.eccLib);
2929
return opts.eccLib;
3030
});
3131
(0, types_1.typeforce)(

src/payments/testecc.d.ts

-2
This file was deleted.

src/payments/verifyecc.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import { TinySecp256k1Interface } from '../types';
2+
export declare function verifyEcc(ecc: TinySecp256k1Interface): void;

src/payments/testecc.js renamed to src/payments/verifyecc.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22
Object.defineProperty(exports, '__esModule', { value: true });
3-
exports.testEcc = void 0;
3+
exports.verifyEcc = void 0;
44
const h = hex => Buffer.from(hex, 'hex');
5-
function testEcc(ecc) {
5+
function verifyEcc(ecc) {
66
assert(typeof ecc.isXOnlyPoint === 'function');
77
assert(
88
ecc.isXOnlyPoint(
@@ -46,7 +46,7 @@ function testEcc(ecc) {
4646
}
4747
});
4848
}
49-
exports.testEcc = testEcc;
49+
exports.verifyEcc = verifyEcc;
5050
function assert(bool) {
5151
if (!bool) throw new Error('ecc library invalid');
5252
}

ts_src/payments/p2tr.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import { Payment, PaymentOpts } from './index';
1515
import * as lazy from './lazy';
1616
import { bech32m } from 'bech32';
17-
import { testEcc } from './testecc';
17+
import { verifyEcc } from './verifyecc';
1818

1919
const OPS = bscript.OPS;
2020
const TAPROOT_WITNESS_VERSION = 0x01;
@@ -36,7 +36,7 @@ export function p2tr(a: Payment, opts?: PaymentOpts): Payment {
3636
const _ecc = lazy.value(() => {
3737
if (!opts!.eccLib) throw new Error('ECC Library is missing for p2tr.');
3838

39-
testEcc(opts!.eccLib);
39+
verifyEcc(opts!.eccLib);
4040
return opts!.eccLib;
4141
});
4242

ts_src/payments/testecc.ts renamed to ts_src/payments/verifyecc.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { TinySecp256k1Interface } from '../types';
22

33
const h = (hex: string): Buffer => Buffer.from(hex, 'hex');
44

5-
export function testEcc(ecc: TinySecp256k1Interface): void {
5+
export function verifyEcc(ecc: TinySecp256k1Interface): void {
66
assert(typeof ecc.isXOnlyPoint === 'function');
77
assert(
88
ecc.isXOnlyPoint(

0 commit comments

Comments
 (0)