Skip to content

Commit be19fc6

Browse files
committed
v6.9.0
- Fix Segwit address equality operation.
1 parent 2ef8b06 commit be19fc6

7 files changed

Lines changed: 40 additions & 34 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 6.9.0
2+
3+
- Fix Segwit address equality operation.
4+
15
## 6.8.0
26

37
- Update dependencies.

example/pubspec.lock

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ packages:
1515
path: ".."
1616
relative: true
1717
source: path
18-
version: "6.6.0"
18+
version: "6.8.0"
1919
blockchain_utils:
2020
dependency: "direct main"
2121
description:
2222
name: blockchain_utils
23-
sha256: "2681bc950d31fd12eff8b9ea803d686a845a69f94fa88fdefc8c12ad63f55837"
23+
sha256: edc360f7f2a8978d089a34dd62a5dfad303c79260e5f6207e1709fed80c84334
2424
url: "https://pub.dev"
2525
source: hosted
26-
version: "5.1.0"
26+
version: "5.2.0"
2727
boolean_selector:
2828
dependency: transitive
2929
description:
@@ -110,26 +110,26 @@ packages:
110110
dependency: transitive
111111
description:
112112
name: leak_tracker
113-
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
113+
sha256: "8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0"
114114
url: "https://pub.dev"
115115
source: hosted
116-
version: "10.0.9"
116+
version: "11.0.1"
117117
leak_tracker_flutter_testing:
118118
dependency: transitive
119119
description:
120120
name: leak_tracker_flutter_testing
121-
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
121+
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
122122
url: "https://pub.dev"
123123
source: hosted
124-
version: "3.0.9"
124+
version: "3.0.10"
125125
leak_tracker_testing:
126126
dependency: transitive
127127
description:
128128
name: leak_tracker_testing
129-
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
129+
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
130130
url: "https://pub.dev"
131131
source: hosted
132-
version: "3.0.1"
132+
version: "3.0.2"
133133
lints:
134134
dependency: transitive
135135
description:
@@ -219,10 +219,10 @@ packages:
219219
dependency: transitive
220220
description:
221221
name: test_api
222-
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
222+
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
223223
url: "https://pub.dev"
224224
source: hosted
225-
version: "0.7.4"
225+
version: "0.7.6"
226226
typed_data:
227227
dependency: transitive
228228
description:
@@ -235,10 +235,10 @@ packages:
235235
dependency: transitive
236236
description:
237237
name: vector_math
238-
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
238+
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
239239
url: "https://pub.dev"
240240
source: hosted
241-
version: "2.1.4"
241+
version: "2.2.0"
242242
vm_service:
243243
dependency: transitive
244244
description:
@@ -256,5 +256,5 @@ packages:
256256
source: hosted
257257
version: "1.1.0"
258258
sdks:
259-
dart: ">=3.7.0-0 <4.0.0"
259+
dart: ">=3.8.0-0 <4.0.0"
260260
flutter: ">=3.18.0-18.0.pre.54"

lib/src/bitcoin/address/segwit_address.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ abstract class SegwitAddress implements BitcoinBaseAddress {
5050
if (other is! SegwitAddress) return false;
5151
if (runtimeType != other.runtimeType) return false;
5252
if (type != other.type) return false;
53-
return addressProgram == addressProgram &&
53+
return addressProgram == other.addressProgram &&
5454
segwitVersion == other.segwitVersion;
5555
}
5656

lib/src/provider/models/electrum/models.dart

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ class ElectrumGetMerkleResponse {
8585
8686
class ElectrumVerbosTxResponse {
8787
final String txId;
88-
final String hash;
89-
final int version;
90-
final int size;
88+
final String? hash;
89+
final int? version;
90+
final int? size;
9191
final int? vsize;
9292
final int? weight;
93-
final int locktime;
94-
final String hex;
93+
final int? locktime;
94+
final String? hex;
9595
final String? blockhash;
9696
final int? confirmations;
9797
final int? time;
@@ -100,11 +100,11 @@ class ElectrumVerbosTxResponse {
100100
return ElectrumVerbosTxResponse(
101101
txId: json["txid"],
102102
hash: json["hash"],
103-
version: IntUtils.parse(json["version"]),
104-
size: IntUtils.parse(json["size"]),
103+
version: IntUtils.tryParse(json["version"]),
104+
size: IntUtils.tryParse(json["size"]),
105105
vsize: IntUtils.tryParse(json["vsize"]),
106106
weight: IntUtils.tryParse(json["weight"]),
107-
locktime: IntUtils.parse(json["locktime"]),
107+
locktime: IntUtils.tryParse(json["locktime"]),
108108
hex: json["hex"],
109109
blockhash: json["blockhash"],
110110
confirmations: IntUtils.tryParse(json["confirmations"]),
@@ -113,13 +113,13 @@ class ElectrumVerbosTxResponse {
113113
}
114114
const ElectrumVerbosTxResponse(
115115
{required this.txId,
116-
required this.hash,
117-
required this.version,
118-
required this.size,
119-
required this.vsize,
120-
required this.weight,
121-
required this.locktime,
122-
required this.hex,
116+
this.hash,
117+
this.version,
118+
this.size,
119+
this.vsize,
120+
this.weight,
121+
this.locktime,
122+
this.hex,
123123
this.blockhash,
124124
this.confirmations,
125125
this.time,

lib/src/provider/models/multisig_script.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class MultiSignatureAddress {
8181
}
8282

8383
BitcoinBaseAddress toP2shAddress(
84-
[P2shAddressType addressType = P2shAddressType.p2pkhInP2sh]) {
84+
{P2shAddressType addressType = P2shAddressType.p2pkhInP2sh}) {
8585
if (!legacySupportP2shTypes.contains(addressType)) {
8686
throw DartBitcoinPluginException(
8787
"invalid p2sh type please use one of them ${legacySupportP2shTypes.map((e) => "$e").join(", ")}");
@@ -108,7 +108,7 @@ class MultiSignatureAddress {
108108
case P2shAddressType.p2pkhInP2sh32:
109109
case P2shAddressType.p2pkhInP2shwt:
110110
case P2shAddressType.p2pkhInP2sh32wt:
111-
return toP2shAddress(addressType as P2shAddressType);
111+
return toP2shAddress(addressType: addressType as P2shAddressType);
112112
default:
113113
throw const DartBitcoinPluginException(
114114
'invalid multisig address type. use of of them [BitcoinAddressType.p2wsh, BitcoinAddressType.p2wshInP2sh, BitcoinAddressType.p2pkhInP2sh]');

lib/src/transaction_builder/transaction_builder.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ class BitcoinTransactionBuilder extends BasedBitcoinTransacationBuilder {
190190
return script;
191191
case P2shAddressType.p2pkhInP2sh:
192192
if (isTaproot) {
193-
return multiSigAAddr.toP2shAddress().toScriptPubKey();
193+
return multiSigAAddr
194+
.toP2shAddress(addressType: P2shAddressType.p2pkhInP2sh)
195+
.toScriptPubKey();
194196
}
195197
return script;
196198
default:

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: bitcoin_base
22
description: A versatile library for Bitcoin, Dogecoin, Litecoin, Dash, BSV, and BCH. Supports P2PKH, P2SH, P2WPKH, P2WSH, P2TR, with advanced creation, signing, and spending capabilities.
3-
version: 6.8.0
3+
version: 6.9.0
44
homepage: "https://github.com/mrtnetwork/bitcoin_base"
55
repository: "https://github.com/mrtnetwork/bitcoin_base"
66
Author: mrhaydari.t@gmail.com

0 commit comments

Comments
 (0)