Skip to content

Commit

Permalink
v4.8.0
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
mrtnetwork committed Oct 1, 2024
1 parent 6c38c1a commit 7a82c69
Show file tree
Hide file tree
Showing 24 changed files with 103 additions and 102 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.8.0

* Update dependencies

## 4.7.0

* Update dependencies
Expand Down
30 changes: 15 additions & 15 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ packages:
path: ".."
relative: true
source: path
version: "4.7.0"
version: "4.8.0"
blockchain_utils:
dependency: "direct main"
description:
name: blockchain_utils
sha256: aebc3a32b927b34f638817c4bfdb85f86a97e6ad35f0cd962660b0c6e8d5c56b
sha256: ebb6c336ba0120de0982c50d8bc597cb494a530bd22bd462895bb5cebde405af
url: "https://pub.dev"
source: hosted
version: "3.3.0"
version: "3.4.0"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -110,18 +110,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
url: "https://pub.dev"
source: hosted
version: "10.0.4"
version: "10.0.5"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
version: "3.0.5"
leak_tracker_testing:
dependency: transitive
description:
Expand Down Expand Up @@ -150,18 +150,18 @@ packages:
dependency: transitive
description:
name: material_color_utilities
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.dev"
source: hosted
version: "0.8.0"
version: "0.11.1"
meta:
dependency: transitive
description:
name: meta
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted
version: "1.12.0"
version: "1.15.0"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -219,10 +219,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.dev"
source: hosted
version: "0.7.0"
version: "0.7.2"
typed_data:
dependency: transitive
description:
Expand All @@ -243,10 +243,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "14.2.1"
version: "14.2.5"
web:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies:
path: ../
# blockchain_utils:
# path: ../../blockchain_utils
blockchain_utils: ^3.3.0
blockchain_utils: ^3.4.0
http: ^1.2.0

dev_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion lib/src/bitcoin/address/core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ abstract class BitcoinAddressType implements Enumerate {
/// Factory method to create a BitcoinAddressType enum value from a name or value.
static BitcoinAddressType fromValue(String value) {
return values.firstWhere((element) => element.value == value,
orElse: () => throw BitcoinBasePluginException(
orElse: () => throw DartBitcoinPluginException(
'Invalid BitcoinAddressType: $value'));
}

Expand Down
6 changes: 3 additions & 3 deletions lib/src/bitcoin/address/legacy_address.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ abstract class LegacyAddress implements BitcoinBaseAddress {
final decode = _BitcoinAddressUtils.decodeLagacyAddressWithNetworkAndType(
address: address, type: type, network: network);
if (decode == null) {
throw BitcoinBasePluginException(
throw DartBitcoinPluginException(
"Invalid ${network.conf.coinName} address");
}
_addressProgram = decode;
Expand Down Expand Up @@ -63,7 +63,7 @@ class P2shAddress extends LegacyAddress {
@override
String toAddress(BasedUtxoNetwork network) {
if (!network.supportedAddress.contains(type)) {
throw BitcoinBasePluginException(
throw DartBitcoinPluginException(
"network does not support ${type.value} address");
}
return super.toAddress(network);
Expand Down Expand Up @@ -111,7 +111,7 @@ class P2pkAddress extends LegacyAddress {
P2pkAddress({required String publicKey}) : super._() {
final toBytes = BytesUtils.fromHexString(publicKey);
if (!Secp256k1PublicKeyEcdsa.isValidBytes(toBytes)) {
throw const BitcoinBasePluginException("Invalid secp256k1 public key");
throw const DartBitcoinPluginException("Invalid secp256k1 public key");
}
publicHex = publicKey;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/bitcoin/address/network_address.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class BitcoinCashAddress extends BitcoinNetworkAddress<BitcoinCashNetwork> {
address, network,
validateNetworkHRP: validateNetworkPrefix);
if (decodeAddress == null) {
throw BitcoinBasePluginException("Invalid ${network.value} address.");
throw DartBitcoinPluginException("Invalid ${network.value} address.");
}
return BitcoinCashAddress._(decodeAddress, address);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/src/bitcoin/address/segwit_address.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ abstract class SegwitAddress implements BitcoinBaseAddress {
required BasedUtxoNetwork network,
required this.segwitVersion}) {
if (!network.supportedAddress.contains(type)) {
throw BitcoinBasePluginException(
throw DartBitcoinPluginException(
"network does not support ${type.value} address");
}
addressProgram = _BitcoinAddressUtils.toSegwitProgramWithVersionAndNetwork(
Expand All @@ -30,7 +30,7 @@ abstract class SegwitAddress implements BitcoinBaseAddress {
@override
String toAddress(BasedUtxoNetwork network) {
if (!network.supportedAddress.contains(type)) {
throw BitcoinBasePluginException(
throw DartBitcoinPluginException(
"network does not support ${type.value} address");
}
return _BitcoinAddressUtils.segwitToAddress(
Expand Down
10 changes: 5 additions & 5 deletions lib/src/bitcoin/address/utils/address_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class _BitcoinAddressUtils {
final convert = SegwitBech32Decoder.decode(network.p2wpkhHrp, address);
final witnessVersion = convert.item1;
if (witnessVersion != version) {
throw const BitcoinBasePluginException("Invalid segwit version");
throw const DartBitcoinPluginException("Invalid segwit version");
}
return BytesUtils.toHexString(convert.item2);
}
Expand Down Expand Up @@ -137,7 +137,7 @@ class _BitcoinAddressUtils {
if (network.supportedAddress.contains(address.type)) {
return address;
}
throw BitcoinBasePluginException(
throw DartBitcoinPluginException(
"${network.value} does not support ${address.type.value} address");
}

Expand All @@ -158,7 +158,7 @@ class _BitcoinAddressUtils {
}
baseAddress ??= toLegacy(address, network);
if (baseAddress == null) {
throw const BitcoinBasePluginException("Invalid Bitcoin address");
throw const DartBitcoinPluginException("Invalid Bitcoin address");
}
return validateAddress(baseAddress, network);
}
Expand All @@ -180,7 +180,7 @@ class _BitcoinAddressUtils {
}
// ignore: empty_catches
} catch (e) {}
throw const BitcoinBasePluginException(
throw const DartBitcoinPluginException(
"Invalid Bitcoin address program length (program length should be 32 or 20 bytes)");
}

Expand Down Expand Up @@ -276,7 +276,7 @@ class _BitcoinAddressUtils {
required BitcoinAddressType type,
required BasedUtxoNetwork network}) {
if (!network.supportedAddress.contains(type)) {
throw BitcoinBasePluginException(
throw DartBitcoinPluginException(
"${network.value} does not support ${type.value} address type");
}
if (network is BitcoinCashNetwork) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/bitcoin/script/input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class TxInput {
List<int> inpHash =
txInputRaw.sublist(cursor, cursor + 32).reversed.toList();
if (inpHash.isEmpty) {
throw const BitcoinBasePluginException(
throw const DartBitcoinPluginException(
"Input transaction hash not found. Probably malformed raw transaction");
}
List<int> outputN =
Expand Down
4 changes: 2 additions & 2 deletions lib/src/bitcoin/script/op_code/tools.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ List<int> opPushData(String hexData) {
writeUint32LE(lengthBytes.length, lengthBytes);
return List<int>.from([0x4e, ...lengthBytes, ...dataBytes]);
} else {
throw const BitcoinBasePluginException(
throw const DartBitcoinPluginException(
"Data too large. Cannot push into script");
}
}

List<int> pushInteger(int integer) {
if (integer < 0) {
throw const BitcoinBasePluginException(
throw const DartBitcoinPluginException(
'Integer is currently required to be positive.');
}

Expand Down
6 changes: 3 additions & 3 deletions lib/src/bitcoin/script/sequence.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Sequence {
{required this.seqType, required this.value, this.isTypeBlock = true}) {
if (seqType == BitcoinOpCodeConst.TYPE_RELATIVE_TIMELOCK &&
(value < 1 || value > mask16)) {
throw const BitcoinBasePluginException(
throw const DartBitcoinPluginException(
'Sequence should be between 1 and 65535');
}
}
Expand All @@ -39,13 +39,13 @@ class Sequence {
return IntUtils.toBytes(seq, length: 4, byteOrder: Endian.little);
}

throw const BitcoinBasePluginException("Invalid seqType");
throw const DartBitcoinPluginException("Invalid seqType");
}

/// Returns the appropriate integer for a script; e.g. for relative timelocks
int forScript() {
if (seqType == BitcoinOpCodeConst.TYPE_REPLACE_BY_FEE) {
throw const BitcoinBasePluginException(
throw const DartBitcoinPluginException(
"RBF is not to be included in a script.");
}
int scriptIntiger = value;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/bitcoin/script/transaction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class BtcTransaction {
}
} else if ((sighash & 0x1f) == BitcoinOpCodeConst.SIGHASH_SINGLE) {
if (txInIndex >= tx.outputs.length) {
throw const BitcoinBasePluginException(
throw const DartBitcoinPluginException(
"Transaction index is greater than the available outputs");
}

Expand Down
18 changes: 9 additions & 9 deletions lib/src/cash_token/cash_token.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class CashTokenCapability {
final int intCapability = _getCapability(bitfield);
return values.firstWhere((element) => element.value == intCapability);
} on StateError {
throw const BitcoinBasePluginException(
throw const DartBitcoinPluginException(
"Invalid CashToken NFT Capability");
}
}
Expand All @@ -73,7 +73,7 @@ class CashTokenCapability {
try {
return values.firstWhere((element) => element.name == name);
} on StateError {
throw const BitcoinBasePluginException(
throw const DartBitcoinPluginException(
"Invalid CashToken NFT Capability Name");
}
}
Expand Down Expand Up @@ -273,30 +273,30 @@ class CashToken {
List<int>? commitment,
required int bitfield}) {
if (!CashTokenUtils.isValidBitfield(bitfield)) {
throw const BitcoinBasePluginException("Invalid bitfield");
throw const DartBitcoinPluginException("Invalid bitfield");
}
if (CashTokenUtils.hasAmount(bitfield) && amount == null) {
throw const BitcoinBasePluginException(
throw const DartBitcoinPluginException(
"Invalid cash token: the bitfield indicates an amount, but the amount is null.");
}
if (amount != null) {
if (amount < BigInt.zero || amount > CashTokenUtils.maxTokenAmount) {
throw const BitcoinBasePluginException(
throw const DartBitcoinPluginException(
"Invalid amount. Amount must be between zero and 99.");
}
}
if (!StringUtils.isHexBytes(category)) {
throw const BitcoinBasePluginException(
throw const DartBitcoinPluginException(
"Invalid category hexadecimal bytes.");
}
final toBytes = BytesUtils.fromHexString(category);
if (toBytes.length != CashTokenUtils.idBytesLength) {
throw const BitcoinBasePluginException(
throw const DartBitcoinPluginException(
"Invalid category. The category should consist of 32 bytes.");
}
if (CashTokenUtils.hasCommitmentLength(bitfield) &&
(commitment == null || commitment.isEmpty)) {
throw const BitcoinBasePluginException(
throw const DartBitcoinPluginException(
"Invalid cash token: the bitfield indicates an commitment, but the commitment is null or empty.");
}
return CashToken.noValidate(
Expand Down Expand Up @@ -336,7 +336,7 @@ class CashToken {
amount < BigInt.zero ||
amount > CashTokenUtils.maxTokenAmount ||
CashTokenUtils.hasCommitmentLength(bitfield) && commitment.isEmpty) {
throw const BitcoinBasePluginException('Invalid cash token');
throw const DartBitcoinPluginException('Invalid cash token');
}
return Tuple(
CashToken(
Expand Down
2 changes: 1 addition & 1 deletion lib/src/crypto/keypair/ec_public.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ECPublic {

factory ECPublic.fromBip32(Bip32PublicKey publicKey) {
if (publicKey.curveType != EllipticCurveTypes.secp256k1) {
throw const BitcoinBasePluginException(
throw const DartBitcoinPluginException(
"invalid public key curve for bitcoin");
}
return ECPublic._(publicKey);
Expand Down
10 changes: 4 additions & 6 deletions lib/src/exception/exception.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import 'package:blockchain_utils/blockchain_utils.dart';

class BitcoinBasePluginException extends BlockchainUtilsException {
@override
final String message;
@override
final Map<String, dynamic>? details;
const BitcoinBasePluginException(this.message, {this.details});
class DartBitcoinPluginException extends BlockchainUtilsException {
const DartBitcoinPluginException(String message,
{Map<String, dynamic>? details})
: super(message, details: details);
}
8 changes: 4 additions & 4 deletions lib/src/models/network.dart
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ class DashNetwork implements BasedUtxoNetwork {

/// Retrieves the Human-Readable Part (HRP) for Pay-to-Witness-Public-Key-Hash (P2WPKH) addresses.
@override
String get p2wpkhHrp => throw const BitcoinBasePluginException(
String get p2wpkhHrp => throw const DartBitcoinPluginException(
"DashNetwork network does not support P2WPKH/P2WSH");

/// Checks if the current network is the mainnet.
Expand Down Expand Up @@ -341,7 +341,7 @@ class DogecoinNetwork implements BasedUtxoNetwork {

/// Retrieves the Human-Readable Part (HRP) for Pay-to-Witness-Public-Key-Hash (P2WPKH) addresses.
@override
String get p2wpkhHrp => throw const BitcoinBasePluginException(
String get p2wpkhHrp => throw const DartBitcoinPluginException(
"DogecoinNetwork network does not support P2WPKH/P2WSH");

/// Checks if the current network is the mainnet.
Expand Down Expand Up @@ -409,7 +409,7 @@ class BitcoinCashNetwork implements BasedUtxoNetwork {
/// Retrieves the Human-Readable Part (HRP) for Pay-to-Witness-Public-Key-Hash (P2WPKH) addresses
/// from the associated `CoinConf`.
@override
String get p2wpkhHrp => throw const BitcoinBasePluginException(
String get p2wpkhHrp => throw const DartBitcoinPluginException(
"network does not support p2wpkh HRP");

String get networkHRP => conf.params.p2pkhStdHrp!;
Expand Down Expand Up @@ -470,7 +470,7 @@ class PepeNetwork implements BasedUtxoNetwork {

/// Retrieves the Human-Readable Part (HRP) for Pay-to-Witness-Public-Key-Hash (P2WPKH) addresses.
@override
String get p2wpkhHrp => throw const BitcoinBasePluginException(
String get p2wpkhHrp => throw const DartBitcoinPluginException(
"DogecoinNetwork network does not support P2WPKH/P2WSH");

/// Checks if the current network is the mainnet.
Expand Down
Loading

0 comments on commit 7a82c69

Please sign in to comment.