Skip to content

Commit

Permalink
clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtnetwork committed Nov 17, 2024
1 parent 178f1b5 commit 7795747
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 19 deletions.
3 changes: 2 additions & 1 deletion example/lib/test/bip/bip44/bip44.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ void bip44Test() {
assert(account.publicKey.toExtended == accountInfo["account_public"]);
if (coin == Bip44Coins.moneroEd25519Slip ||
coin == Bip44Coins.moneroSecp256k1) {
final addrClass = MoneroAccount.fromBip44PrivateKey(account.privateKey.raw);
final addrClass =
MoneroAccount.fromBip44PrivateKey(account.privateKey.raw);
assert(addrClass.primaryAddress == accountInfo["address"]);
continue;
}
Expand Down
3 changes: 1 addition & 2 deletions lib/bip/ecc/keys/ed25519_blake2b_keys.dart
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,5 @@ class Ed25519Blake2bPrivateKey implements IPrivateKey {
}

@override
int get hashCode =>
HashCodeGenerator.generateHashCode([_privateKey, curve]);
int get hashCode => HashCodeGenerator.generateHashCode([_privateKey, curve]);
}
3 changes: 1 addition & 2 deletions lib/bip/ecc/keys/ed25519_keys.dart
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,5 @@ class Ed25519PrivateKey implements IPrivateKey {
}

@override
int get hashCode =>
HashCodeGenerator.generateHashCode([_privateKey, curve]);
int get hashCode => HashCodeGenerator.generateHashCode([_privateKey, curve]);
}
3 changes: 1 addition & 2 deletions lib/bip/ecc/keys/ed25519_kholaw_keys.dart
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,5 @@ class Ed25519KholawPrivateKey implements IPrivateKey {
}

@override
int get hashCode =>
HashCodeGenerator.generateHashCode([_privateKey, curve]);
int get hashCode => HashCodeGenerator.generateHashCode([_privateKey, curve]);
}
9 changes: 5 additions & 4 deletions lib/bip/monero/monero_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ class MoneroAccount {
seedBytes.length == Ed25519KeysConst.privKeyByteLen
? seedBytes
: QuickCrypto.keccack256Hash(seedBytes);
return MoneroAccount.fromPrivateSpendKey(Ed25519Utils.scalarReduce(privSkeyBytes),
return MoneroAccount.fromPrivateSpendKey(
Ed25519Utils.scalarReduce(privSkeyBytes),
coinType: coinType);
}

Expand Down Expand Up @@ -134,7 +135,8 @@ class MoneroAccount {
/// Monero instance with the associated keys and configurations.
factory MoneroAccount.fromWatchOnly(List<int> privVkey, List<int> pubSkey,
{MoneroCoins coinType = MoneroCoins.moneroMainnet}) {
return MoneroAccount._(privKey: privVkey, pubKey: pubSkey, coinType: coinType);
return MoneroAccount._(
privKey: privVkey, pubKey: pubSkey, coinType: coinType);
}

/// Check if the Monero instance is watch-only (has no private spend key).
Expand Down Expand Up @@ -190,8 +192,7 @@ class MoneroAccount {
}

/// Calculate and return the private view key from the private spend key.
static MoneroPrivateKey _viewFromSpendKey(
MoneroPrivateKey privSkey) {
static MoneroPrivateKey _viewFromSpendKey(MoneroPrivateKey privSkey) {
List<int> privVkeyBytes =
Ed25519Utils.scalarReduce(QuickCrypto.keccack256Hash(privSkey.raw));
return MoneroPrivateKey.fromBytes(privVkeyBytes);
Expand Down
6 changes: 2 additions & 4 deletions lib/bip/monero/monero_subaddr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ class MoneroSubaddress {
///
/// The constructor takes a private view key [privVKey] and a public spend key [pubSKey].
/// Optionally, it can also accept a public view key [publicVkey] (defaulting to `null`).
MoneroSubaddress(this.privVKey, this.pubSKey,
[MoneroPublicKey? publicVkey])
MoneroSubaddress(this.privVKey, this.pubSKey, [MoneroPublicKey? publicVkey])
: pubVKey = publicVkey ?? privVKey.publicKey;

/// Compute the subaddress keys based on minor and major indexes.
Expand Down Expand Up @@ -96,8 +95,7 @@ class MoneroSubaddress {
BigInt mInt = BigintUtils.fromBytes(secretKey, byteOrder: Endian.little);
final newPoint = pubSKey.point + (Curves.generatorED25519 * mInt);

MoneroPublicKey subaddrPubSKey =
MoneroPublicKey.fromPoint(newPoint);
MoneroPublicKey subaddrPubSKey = MoneroPublicKey.fromPoint(newPoint);
MoneroPublicKey subaddrPubVKey = MoneroPublicKey.fromPoint(
(subaddrPubSKey.point *
BigintUtils.fromBytes(privVKey.raw, byteOrder: Endian.little)));
Expand Down
2 changes: 1 addition & 1 deletion lib/crypto/crypto/cdsa/cdsa.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ export 'point/ec_projective_point.dart';
/// allowing for secure signature generation.
export 'rfc6979/rfc6979.dart';

export 'crypto_ops/crypto_ops.dart';
export 'crypto_ops/crypto_ops.dart';
3 changes: 2 additions & 1 deletion lib/layout/core/types/numeric.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ abstract class ExternalLayout extends Layout<int> {
}

abstract class ExternalOffsetLayout extends ExternalLayout {
const ExternalOffsetLayout({String? property}) : super(-1, property: property);
const ExternalOffsetLayout({String? property})
: super(-1, property: property);
LayoutDecodeResult<int> getLenAndSpan(LayoutByteReader bytes,
{int offset = 0});
}
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/binary/binary_operation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ const int minInt32 = -2147483648;
const int maxUint32 = 4294967295;

const int safeUint = 9007199254740991;
const int safeInt = -9007199254740991;
const int safeInt = -9007199254740991;
3 changes: 2 additions & 1 deletion test/bip/bip44/bip44_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ void main() {
expect(account.publicKey.toExtended, accountInfo["account_public"]);
if (coin == Bip44Coins.moneroEd25519Slip ||
coin == Bip44Coins.moneroSecp256k1) {
final addrClass = MoneroAccount.fromBip44PrivateKey(account.privateKey.raw);
final addrClass =
MoneroAccount.fromBip44PrivateKey(account.privateKey.raw);
expect(addrClass.primaryAddress, accountInfo["address"]);
continue;
}
Expand Down
1 change: 1 addition & 0 deletions test/uuid_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:blockchain_utils/blockchain_utils.dart';
import 'package:test/test.dart';

void main() {
List<int> buffer1 = List<int>.from(
[174, 91, 168, 91, 107, 15, 78, 26, 181, 132, 151, 91, 160, 7, 157, 152]);
Expand Down

0 comments on commit 7795747

Please sign in to comment.