Skip to content

Commit

Permalink
fix large script serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtnetwork committed Dec 1, 2024
1 parent 01d915f commit f9b8f24
Show file tree
Hide file tree
Showing 38 changed files with 225 additions and 468 deletions.
7 changes: 7 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@
include: package:flutter_lints/flutter.yaml
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
# Uncomment the following section to specify additional rules.
linter:
rules:
- unnecessary_const
- prefer_const_declarations
- prefer_final_locals # Warns when a local variable could be final
- prefer_final_in_for_each # Warns when a forEach variable could be final
1 change: 0 additions & 1 deletion example/test/bch_test.dart

This file was deleted.

1 change: 0 additions & 1 deletion example/test/btc2_test.dart

This file was deleted.

118 changes: 0 additions & 118 deletions example/test/btc_test.dart

This file was deleted.

1 change: 0 additions & 1 deletion example/test/e_test.dart

This file was deleted.

97 changes: 0 additions & 97 deletions example/test/widget_test.dart

This file was deleted.

2 changes: 1 addition & 1 deletion lib/bitcoin_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// including spending transactions, Bitcoin address management,
/// Bitcoin Schnorr signatures, BIP-39 mnemonic phrase generation,
/// hierarchical deterministic (HD) wallet derivation, and Web3 Secret Storage Definition.
library bitcoin_base;
library;

export 'package:bitcoin_base/src/bitcoin/address/address.dart';

Expand Down
2 changes: 1 addition & 1 deletion lib/src/bitcoin/address/address.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// - Utility functions for address manipulation.
// - encode/decode Segregated Witness (SegWit) address implementation.
// - Enhanced functionality for improved handling of addresses across diverse networks.
library bitcoin_base.address;
library;

import 'package:bitcoin_base/bitcoin_base.dart';
import 'package:bitcoin_base/src/exception/exception.dart';
Expand Down
10 changes: 5 additions & 5 deletions lib/src/bitcoin/address/core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ abstract class BitcoinBaseAddress {
}

class PubKeyAddressType extends BitcoinAddressType {
const PubKeyAddressType._(String value) : super._(value);
const PubKeyAddressType._(super.value) : super._();
static const PubKeyAddressType p2pk = PubKeyAddressType._("P2PK");
@override
bool get isP2sh => false;
Expand All @@ -75,7 +75,7 @@ class PubKeyAddressType extends BitcoinAddressType {
}

class P2pkhAddressType extends BitcoinAddressType {
const P2pkhAddressType._(String value) : super._(value);
const P2pkhAddressType._(super.value) : super._();
static const P2pkhAddressType p2pkh = P2pkhAddressType._("P2PKH");
static const P2pkhAddressType p2pkhwt = P2pkhAddressType._("P2PKHWT");

Expand All @@ -93,8 +93,8 @@ class P2pkhAddressType extends BitcoinAddressType {
}

class P2shAddressType extends BitcoinAddressType {
const P2shAddressType._(String value, this.hashLength, this.withToken)
: super._(value);
const P2shAddressType._(super.value, this.hashLength, this.withToken)
: super._();
static const P2shAddressType p2wshInP2sh = P2shAddressType._(
"P2SH/P2WSH", _BitcoinAddressUtils.hash160DigestLength, false);
static const P2shAddressType p2wpkhInP2sh = P2shAddressType._(
Expand Down Expand Up @@ -143,7 +143,7 @@ class P2shAddressType extends BitcoinAddressType {
}

class SegwitAddresType extends BitcoinAddressType {
const SegwitAddresType._(String value) : super._(value);
const SegwitAddresType._(super.value) : super._();
static const SegwitAddresType p2wpkh = SegwitAddresType._("P2WPKH");
static const SegwitAddresType p2tr = SegwitAddresType._("P2TR");
static const SegwitAddresType p2wsh = SegwitAddresType._("P2WSH");
Expand Down
20 changes: 10 additions & 10 deletions lib/src/bitcoin/address/legacy_address.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ abstract class LegacyAddress implements BitcoinBaseAddress {

class P2shAddress extends LegacyAddress {
P2shAddress.fromScript(
{required Script script, this.type = P2shAddressType.p2pkInP2sh})
: super.fromScript(script: script);
{required super.script, this.type = P2shAddressType.p2pkInP2sh})
: super.fromScript();

P2shAddress.fromAddress(
{required String address,
required BasedUtxoNetwork network,
{required super.address,
required super.network,
this.type = P2shAddressType.p2pkInP2sh})
: super.fromAddress(address: address, network: network);
: super.fromAddress();
P2shAddress.fromHash160(
{required String addrHash, this.type = P2shAddressType.p2pkInP2sh})
: super.fromHash160(addrHash, type);
Expand Down Expand Up @@ -81,13 +81,13 @@ class P2shAddress extends LegacyAddress {

class P2pkhAddress extends LegacyAddress {
P2pkhAddress.fromScript(
{required Script script, this.type = P2pkhAddressType.p2pkh})
: super.fromScript(script: script);
{required super.script, this.type = P2pkhAddressType.p2pkh})
: super.fromScript();
P2pkhAddress.fromAddress(
{required String address,
required BasedUtxoNetwork network,
{required super.address,
required super.network,
this.type = P2pkhAddressType.p2pkh})
: super.fromAddress(address: address, network: network);
: super.fromAddress();
P2pkhAddress.fromHash160(
{required String addrHash, this.type = P2pkhAddressType.p2pkh})
: super.fromHash160(addrHash, type);
Expand Down
Loading

0 comments on commit f9b8f24

Please sign in to comment.