From 7795747aa2c3b9be81ffd21256fca76e304ef1c5 Mon Sep 17 00:00:00 2001 From: Mohsen <56779182+mrtnetwork@users.noreply.github.com> Date: Sun, 17 Nov 2024 18:32:04 +0330 Subject: [PATCH] clean up. --- example/lib/test/bip/bip44/bip44.dart | 3 ++- lib/bip/ecc/keys/ed25519_blake2b_keys.dart | 3 +-- lib/bip/ecc/keys/ed25519_keys.dart | 3 +-- lib/bip/ecc/keys/ed25519_kholaw_keys.dart | 3 +-- lib/bip/monero/monero_base.dart | 9 +++++---- lib/bip/monero/monero_subaddr.dart | 6 ++---- lib/crypto/crypto/cdsa/cdsa.dart | 2 +- lib/layout/core/types/numeric.dart | 3 ++- lib/utils/binary/binary_operation.dart | 2 +- test/bip/bip44/bip44_test.dart | 3 ++- test/uuid_test.dart | 1 + 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/example/lib/test/bip/bip44/bip44.dart b/example/lib/test/bip/bip44/bip44.dart index c938f55..12c3234 100644 --- a/example/lib/test/bip/bip44/bip44.dart +++ b/example/lib/test/bip/bip44/bip44.dart @@ -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; } diff --git a/lib/bip/ecc/keys/ed25519_blake2b_keys.dart b/lib/bip/ecc/keys/ed25519_blake2b_keys.dart index e84e75c..f01a91c 100644 --- a/lib/bip/ecc/keys/ed25519_blake2b_keys.dart +++ b/lib/bip/ecc/keys/ed25519_blake2b_keys.dart @@ -219,6 +219,5 @@ class Ed25519Blake2bPrivateKey implements IPrivateKey { } @override - int get hashCode => - HashCodeGenerator.generateHashCode([_privateKey, curve]); + int get hashCode => HashCodeGenerator.generateHashCode([_privateKey, curve]); } diff --git a/lib/bip/ecc/keys/ed25519_keys.dart b/lib/bip/ecc/keys/ed25519_keys.dart index ee9d4f1..483ca33 100644 --- a/lib/bip/ecc/keys/ed25519_keys.dart +++ b/lib/bip/ecc/keys/ed25519_keys.dart @@ -183,6 +183,5 @@ class Ed25519PrivateKey implements IPrivateKey { } @override - int get hashCode => - HashCodeGenerator.generateHashCode([_privateKey, curve]); + int get hashCode => HashCodeGenerator.generateHashCode([_privateKey, curve]); } diff --git a/lib/bip/ecc/keys/ed25519_kholaw_keys.dart b/lib/bip/ecc/keys/ed25519_kholaw_keys.dart index ec9ed6d..f58f709 100644 --- a/lib/bip/ecc/keys/ed25519_kholaw_keys.dart +++ b/lib/bip/ecc/keys/ed25519_kholaw_keys.dart @@ -174,6 +174,5 @@ class Ed25519KholawPrivateKey implements IPrivateKey { } @override - int get hashCode => - HashCodeGenerator.generateHashCode([_privateKey, curve]); + int get hashCode => HashCodeGenerator.generateHashCode([_privateKey, curve]); } diff --git a/lib/bip/monero/monero_base.dart b/lib/bip/monero/monero_base.dart index f87b563..d9c642d 100644 --- a/lib/bip/monero/monero_base.dart +++ b/lib/bip/monero/monero_base.dart @@ -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); } @@ -134,7 +135,8 @@ class MoneroAccount { /// Monero instance with the associated keys and configurations. factory MoneroAccount.fromWatchOnly(List privVkey, List 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). @@ -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 privVkeyBytes = Ed25519Utils.scalarReduce(QuickCrypto.keccack256Hash(privSkey.raw)); return MoneroPrivateKey.fromBytes(privVkeyBytes); diff --git a/lib/bip/monero/monero_subaddr.dart b/lib/bip/monero/monero_subaddr.dart index c36bc80..14d2329 100644 --- a/lib/bip/monero/monero_subaddr.dart +++ b/lib/bip/monero/monero_subaddr.dart @@ -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. @@ -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))); diff --git a/lib/crypto/crypto/cdsa/cdsa.dart b/lib/crypto/crypto/cdsa/cdsa.dart index dd9842d..d9bac7b 100644 --- a/lib/crypto/crypto/cdsa/cdsa.dart +++ b/lib/crypto/crypto/cdsa/cdsa.dart @@ -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'; \ No newline at end of file +export 'crypto_ops/crypto_ops.dart'; diff --git a/lib/layout/core/types/numeric.dart b/lib/layout/core/types/numeric.dart index 779d4a3..7213926 100644 --- a/lib/layout/core/types/numeric.dart +++ b/lib/layout/core/types/numeric.dart @@ -16,7 +16,8 @@ abstract class ExternalLayout extends Layout { } abstract class ExternalOffsetLayout extends ExternalLayout { - const ExternalOffsetLayout({String? property}) : super(-1, property: property); + const ExternalOffsetLayout({String? property}) + : super(-1, property: property); LayoutDecodeResult getLenAndSpan(LayoutByteReader bytes, {int offset = 0}); } diff --git a/lib/utils/binary/binary_operation.dart b/lib/utils/binary/binary_operation.dart index 06f37ad..f254389 100644 --- a/lib/utils/binary/binary_operation.dart +++ b/lib/utils/binary/binary_operation.dart @@ -129,4 +129,4 @@ const int minInt32 = -2147483648; const int maxUint32 = 4294967295; const int safeUint = 9007199254740991; -const int safeInt = -9007199254740991; \ No newline at end of file +const int safeInt = -9007199254740991; diff --git a/test/bip/bip44/bip44_test.dart b/test/bip/bip44/bip44_test.dart index 6106d6e..32dbb20 100644 --- a/test/bip/bip44/bip44_test.dart +++ b/test/bip/bip44/bip44_test.dart @@ -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; } diff --git a/test/uuid_test.dart b/test/uuid_test.dart index 7fce058..5c3c8cc 100644 --- a/test/uuid_test.dart +++ b/test/uuid_test.dart @@ -1,5 +1,6 @@ import 'package:blockchain_utils/blockchain_utils.dart'; import 'package:test/test.dart'; + void main() { List buffer1 = List.from( [174, 91, 168, 91, 107, 15, 78, 26, 181, 132, 151, 91, 160, 7, 157, 152]);