Skip to content

Commit 12e03e3

Browse files
committed
add non-standard payment support
1 parent 0190d23 commit 12e03e3

File tree

6 files changed

+7
-40
lines changed

6 files changed

+7
-40
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,8 @@
2525

2626
## 1.0.5
2727

28-
- Add ECPair to index
28+
- Add ECPair to index
29+
30+
## 1.0.6
31+
32+
- Accept non-standard payment

example/bitcoin_flutter_example.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import 'package:bitcoin_flutter/bitcoin_flutter.dart';
22
import 'package:bip39/bip39.dart' as bip39;
3-
43
main() {
54
var seed = bip39.mnemonicToSeed(
65
"praise you muffin lion enable neck grocery crumble super myself license ghost");

lib/src/transaction.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ class Input {
303303
}
304304
factory Input.expandInput(Uint8List scriptSig) {
305305
if (_isP2PKHInput(scriptSig) == false) {
306-
throw ArgumentError("Invalid or non-support script");
306+
return new Input(prevOutScript: scriptSig);
307307
}
308308
P2PKH p2pkh = new P2PKH(data: new P2PKHData(input: scriptSig));
309309
return new Input(

lib/src/transaction_builder.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ class TransactionBuilder {
123123
input.pubkeys = [ourPubKey];
124124
input.signScript = prevOutScript;
125125
}
126-
if (input.prevOutScript != null && !isValidOutput(input.prevOutScript))
127-
throw ArgumentError('PrevOutScript invalid');
128126
var signatureHash =
129127
this._tx.hashForSignature(vin, input.signScript, hashType);
130128
// enforce in order signing of public keys

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: bitcoin_flutter
22
description: A dart Bitcoin library for Flutter. BIP32, BIP39, P2PKH integration.
3-
version: 1.0.5
3+
version: 1.0.6
44
homepage: https://github.com/anicdh
55
author: andoan <[email protected]>
66

test/fixtures/transaction_builder.json

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -556,18 +556,6 @@
556556
"value": 1000
557557
}
558558
]
559-
},
560-
{
561-
"description": "Transaction w/ invalid scripts",
562-
"exception": "Invalid or non-support script",
563-
"incomplete": true,
564-
"txHex": "010000000100000000171a0000e028f2000000000050178500000000000d0000000e000000000000002009f691b2263260e71f363d1db51ff3100d285956a40cc0e4f8c8c2c4a80559b1ffffffff0110270000000000001976a914aa4d7985c57e011a8b3dd8e0e5a73aaef41629c588ac00000000"
565-
},
566-
{
567-
"description": "Complete transaction w/ non-standard inputs",
568-
"exception": "Invalid or non-support script",
569-
"incomplete": true,
570-
"txHex": "010000000100000000171a0000e028f2000000000050178500000000000d0000000e00000000000000201ff691b2263260e71f363d1db51ff3100d285956a40cc0e4f8c8c2c4a80559b1ffffffff0110270000000000001976a914aa4d7985c57e011a8b3dd8e0e5a73aaef41629c588ac00000000"
571559
}
572560
],
573561
"sign": [
@@ -620,28 +608,6 @@
620608
}
621609
]
622610
},
623-
{
624-
"exception": "PrevOutScript invalid",
625-
"inputs": [
626-
{
627-
"txId": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
628-
"vout": 0,
629-
"prevTxScript": "OP_RETURN 06deadbeef03f895a2ad89fb6d696497af486cb7c644a27aa568c7a18dd06113401115185474",
630-
"signs": [
631-
{
632-
"keyPair": "KzrA86mCVMGWnLGBQu9yzQa32qbxb5dvSK4XhyjjGAWSBKYX4rHx",
633-
"throws": true
634-
}
635-
]
636-
}
637-
],
638-
"outputs": [
639-
{
640-
"script": "OP_DUP OP_HASH160 aa4d7985c57e011a8b3dd8e0e5a73aaef41629c5 OP_EQUALVERIFY OP_CHECKSIG",
641-
"value": 1000
642-
}
643-
]
644-
},
645611
{
646612
"description": "Transaction w/ no outputs (but 1 SIGHASH_NONE)",
647613
"exception": "Transaction needs outputs",

0 commit comments

Comments
 (0)