This module provides useful test fixtures.
Most test fixtures are derived from the same BIP39 seed phrase (which is also included as a fixture).
Test transactions are multisig which allows them to have one of the keys be the open source (private) key above and another be private (private key). This doubly-private key is held by Unchained Capital.
Multisig addresses built from both keys have the advantage that they are open enough to test most aspects of transaction authoring & signing while remaining impossible to spend from without having the private (private) key. This enables robust public tests of multisig addresses in testnet and mainnet.
All the fixtures in this module are accessible through the
TEST_FIXTURES
constant.
- Source:
Members
(static, constant) TEST_FIXTURES
A set of test fixtures mostly built from the same BIP39 seed phrase.
Initializing your keystore with this seed phrase will allow you to replicate many of the unit (and integration) tests in this library on your hardware/software. This is also useful for functional testing.
Includes the following properties:
keys
- given the multisig nature of these fixtures, they involve keys from multiple sourcesopen_source
- open source fixtures-
`bip39Phrase` -- the BIP39 seed phrase used for all other fixtures
-
`nodes` -- an object mapping BIP32 paths to the corresponding HD node derived from the BIP39 seed phrase above.
unchained
- unchained fixtures-
`nodes` -- an object mapping BIP32 paths to the corresponding HD node derived from unchained seed phrase (not shared).
multisigs
-- an array of multisig addresses derived from the HD nodes above.braids
-- an array of braids derived from the open_source + unchained HD nodes above.transactions
-- an array of transactions from the multisig address above.
- Source:
Example
import {TEST_FIXTURES} from "unchained-bitcoin";
console.log(TEST_FIXTURES.keys.open_source.bip39Phrase);
// merge alley lucky axis penalty manage latin gasp virus captain wheel deal chase fragile chapter boss zero dirt stadium tooth physical valve kid plunge