diff --git a/coinlib/test/tx/transaction_test.dart b/coinlib/test/tx/transaction_test.dart index 51fad59..57f61a6 100644 --- a/coinlib/test/tx/transaction_test.dart +++ b/coinlib/test/tx/transaction_test.dart @@ -229,6 +229,7 @@ void main() { prevOut: examplePrevOut, publicKey: pubkey, ), + RawInput(prevOut: examplePrevOut, scriptSig: Uint8List(0)), ], outputs: [], ); @@ -251,7 +252,7 @@ void main() { expect(tx.sign(inputN: 1, key: privkey), isA()); // Input out of range - expect(() => tx.sign(inputN: 2, key: privkey), throwsArgumentError); + expect(() => tx.sign(inputN: 3, key: privkey), throwsArgumentError); // Wrong key expect( @@ -259,12 +260,18 @@ void main() { throwsA(isA()), ); - // Cannot sign witness input + // Cannot sign witness input without value expect( () => tx.sign(inputN: 0, key: privkey), throwsA(isA()), ); + // Cannot sign raw unmatched input + expect( + () => tx.sign(inputN: 2, key: privkey), + throwsA(isA()), + ); + }); test("immutable inputs/outputs", () {