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

Tests for remainder of SizeEstimation cases #75

Open
1 of 4 tasks
afk11 opened this issue Nov 7, 2017 · 0 comments
Open
1 of 4 tasks

Tests for remainder of SizeEstimation cases #75

afk11 opened this issue Nov 7, 2017 · 0 comments

Comments

@afk11
Copy link
Contributor

afk11 commented Nov 7, 2017

We test multisig in a few forms, but we should support size estimation of any of the following:

  • p2wpkh, and P2SH(p2wpkh)
  • multisig, and P2SH(multisig), and P2WSH(multisig), and P2SH(P2WSH(multisig))
  • p2pk, and P2SH(p2pk), and P2WSH(p2pk), and P2SH(P2WSH(p2pk))
  • p2pkh, and P2SH(p2pkh), and P2WSH(p2pkh), and P2SH(P2WSH(p2pkh))

The test cases are organized into stack tests, which only need to know the p2pkh, p2pk, or multisig part (no p2sh or p2wsh knowledge is required for these)

var multisigStackFixtures = (function() {

The next part is testing every possible representation of the three basic supported types. This means testing it by itself, as P2SH, along with P2WSH & and P2SH(P2WSH()) if it's allowed (P2WPKH can't be wrapped in P2WSH). This tests the estimation of the full scriptSig and witness.

var multisigStackFixtures = (function() {

Not the best illustrative example, but finally there are tests of estimating the size of a utxo object.

multisigUtxoFixtures.map(function(fixture) {

The last two could probably be unified a bit, but though for now it shows what we need :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant