Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace tiny-secp256k1 with bitcoinerlab #298

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 25 additions & 157 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
"./lib/esm/wordlists/wordlists.js": "./lib/esm/wordlists/wordlists-browser.js"
},
"dependencies": {
"@bitcoinerlab/secp256k1": "^1.1.1",
"@brandonblack/musig": "^0.0.1-alpha.1",
"@noble/curves": "1.2.0",
"@noble/hashes": "1.3.2",
"@samouraiwallet/bip32": "^5.1.0",
"@scure/base": "^1.1.9",
"aes-js": "4.0.0-beta.5",
"dotenv": "^16.4.1",
"google-protobuf": "^3.21.4",
"tiny-secp256k1": "^2.2.3",
"tslib": "^2.6.2",
"ws": "^8.17.1"
},
Expand Down
11 changes: 6 additions & 5 deletions src/_tests/unit/bip47.unit.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Mnemonic, QiHDWallet } from '../../index.js';
import { Mnemonic, QiHDWallet, Zone } from '../../index.js';
import assert from 'assert';

describe('Test generation of payment codes and payment addresses', function () {
this.timeout(10000);
const ALICE_MNEMONIC =
'empower cook violin million wool twelve involve nice donate author mammal salt royal shiver birth olympic embody hello beef suit isolate mixed text spot';
const aliceMnemonic = Mnemonic.fromPhrase(ALICE_MNEMONIC);
Expand All @@ -26,11 +27,11 @@ describe('Test generation of payment codes and payment addresses', function () {
);

// Alice generates a payment address for sending funds to Bob
const bobAddress = await aliceQiWallet.generateSendAddress(bobPaymentCode);
assert.equal(bobAddress, '0x798e976dfAffe2174c3b21ac7116A35D09DB837d');
const bobAddress = await aliceQiWallet.generateSendAddress(bobPaymentCode, Zone.Cyprus1);
assert.equal(bobAddress, '0x0083d552Fc0A3f9269089cbb9Ca11eaba93802e3');

// Bob generates a payment address for receiving funds from Alice
const receiveAddress = await bobQiWallet.generateReceiveAddress(alicePaymentCode);
assert.equal(receiveAddress, '0x798e976dfAffe2174c3b21ac7116A35D09DB837d');
const receiveAddress = await bobQiWallet.generateReceiveAddress(alicePaymentCode, Zone.Cyprus1);
assert.equal(receiveAddress, '0x0083d552Fc0A3f9269089cbb9Ca11eaba93802e3');
});
});
Loading
Loading