tests/payments/p2pk*: add signature mismatch tests

This commit is contained in:
Daniel Cousens 2018-07-27 20:44:02 +10:00
parent 3ed77c4820
commit 55207e5742
3 changed files with 21 additions and 1 deletions

View file

@ -65,7 +65,7 @@ function p2pk (a, opts) {
} }
if (a.signature) { if (a.signature) {
if (a.input && !a.input.equals(o.input)) throw new TypeError('Input mismatch') if (a.input && !a.input.equals(o.input)) throw new TypeError('Signature mismatch')
} }
if (a.input) { if (a.input) {

View file

@ -116,6 +116,19 @@
"pubkey": "030000000000000000000000000000000000000000000000000000000000000001", "pubkey": "030000000000000000000000000000000000000000000000000000000000000001",
"input": "ffffffffffffffff" "input": "ffffffffffffffff"
} }
},
{
"exception": "Input has invalid signature",
"arguments": {
"input": "30060201ff0201ff01"
}
},
{
"exception": "Signature mismatch",
"arguments": {
"signature": "300602010002010001",
"input": "300602010302010301"
}
} }
], ],
"dynamic": { "dynamic": {

View file

@ -204,6 +204,13 @@
"hash": "ffffffffffffffffffffffffffffffffffffffff", "hash": "ffffffffffffffffffffffffffffffffffffffff",
"input": "300602010002010001 030000000000000000000000000000000000000000000000000000000000000001" "input": "300602010002010001 030000000000000000000000000000000000000000000000000000000000000001"
} }
},
{
"exception": "Signature mismatch",
"arguments": {
"signature": "300602010002010001",
"input": "300602010302010301 030000000000000000000000000000000000000000000000000000000000000001"
}
} }
], ],
"dynamic": { "dynamic": {