From 106a5ee25ac455ae7ae8708b5bbf3b6646adb1d0 Mon Sep 17 00:00:00 2001 From: StaxoLotl Date: Mon, 20 Mar 2023 22:46:55 -0400 Subject: [PATCH 1/2] createDescriptor() Updated --- ios/Podfile.lock | 4 +- lib/infrastructure/wallet/wallet_service.dart | 2 +- pubspec.lock | 373 ++++++++++++------ pubspec.yaml | 5 +- 4 files changed, 250 insertions(+), 134 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 1573be4..936b05e 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -30,12 +30,12 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/path_provider_ios/ios" SPEC CHECKSUMS: - bdk_flutter: 9d3a8e3759b7accafdec05390ee4d61e2bd6b150 + bdk_flutter: e07886d29c53a9c7deba3bec3b20418ce5bd9787 connectivity_plus: 413a8857dd5d9f1c399a39130850d02fe0feaf7e Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02 ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 -PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 +PODFILE CHECKSUM: 7d714a5ac7fda1315bc261738086cf00fa98c7e3 COCOAPODS: 1.11.3 diff --git a/lib/infrastructure/wallet/wallet_service.dart b/lib/infrastructure/wallet/wallet_service.dart index e50e1ab..e534bff 100644 --- a/lib/infrastructure/wallet/wallet_service.dart +++ b/lib/infrastructure/wallet/wallet_service.dart @@ -165,7 +165,7 @@ Future createDescriptorSecret(WalletDto walletDto, KeychainKind keyC mnemonic: mnemonic, password: walletDto.password ); - final descriptor = await Descriptor.newBip84(secretKey: descriptorSecretKey.asString(), network: walletDto.network, keyChainKind: keyChainKind); + final descriptor = await Descriptor.newBip84(secretKey: descriptorSecretKey, network: walletDto.network, keychain: keyChainKind); return descriptor; } diff --git a/pubspec.lock b/pubspec.lock index 91158f4..37ba4c6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,273 +5,312 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + sha256: "3444216bfd127af50bbe4862d8843ed44db946dd933554f0d7285e89f10e28ac" + url: "https://pub.dev" source: hosted version: "50.0.0" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.dartlang.org" + sha256: "68796c31f510c8455a06fed75fc97d8e5ad04d324a830322ab3efc9feb6201c1" + url: "https://pub.dev" source: hosted version: "5.2.0" archive: dependency: transitive description: name: archive - url: "https://pub.dartlang.org" + sha256: d6347d54a2d8028e0437e3c099f66fdb8ae02c4720c1e7534c9f24c10351f85d + url: "https://pub.dev" source: hosted version: "3.3.6" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: b003c3098049a51720352d219b0bb5f219b60fbfb68e7a4748139a06a5676515 + url: "https://pub.dev" source: hosted version: "2.3.1" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.10.0" bdk_flutter: dependency: "direct main" description: name: bdk_flutter - url: "https://pub.dartlang.org" + sha256: "951976492ca658908798a183699b48e2f62c5c8235f398de04a869a02eb3cf54" + url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.28.0" bloc: dependency: transitive description: name: bloc - url: "https://pub.dartlang.org" + sha256: bd4f8027bfa60d96c8046dec5ce74c463b2c918dce1b0d36593575995344534a + url: "https://pub.dev" source: hosted version: "8.1.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" build: dependency: transitive description: name: build - url: "https://pub.dartlang.org" + sha256: "3fbda25365741f8251b39f3917fb3c8e286a96fd068a5a242e11c2012d495777" + url: "https://pub.dev" source: hosted version: "2.3.1" build_cli_annotations: dependency: transitive description: name: build_cli_annotations - url: "https://pub.dartlang.org" + sha256: b59d2769769efd6c9ff6d4c4cede0be115a566afc591705c2040b707534b1172 + url: "https://pub.dev" source: hosted version: "2.1.0" build_config: dependency: transitive description: name: build_config - url: "https://pub.dartlang.org" + sha256: "5b7355c14258f5e7df24bad1566f7b991de3e54aeacfb94e1a65e5233d9739c1" + url: "https://pub.dev" source: hosted version: "1.1.0" build_daemon: dependency: transitive description: name: build_daemon - url: "https://pub.dartlang.org" + sha256: "6bc5544ea6ce4428266e7ea680e945c68806c4aae2da0eb5e9ccf38df8d6acbf" + url: "https://pub.dev" source: hosted version: "3.1.0" build_resolvers: dependency: transitive description: name: build_resolvers - url: "https://pub.dartlang.org" + sha256: "687cf90a3951affac1bd5f9ecb5e3e90b60487f3d9cdc359bb310f8876bb02a6" + url: "https://pub.dev" source: hosted version: "2.0.10" build_runner: dependency: "direct dev" description: name: build_runner - url: "https://pub.dartlang.org" + sha256: "6f48c61a9dcd2c3a9e62d3dcdab1ba382790e2f31026288cbabe55d6003c9c23" + url: "https://pub.dev" source: hosted version: "2.3.2" build_runner_core: dependency: transitive description: name: build_runner_core - url: "https://pub.dartlang.org" + sha256: "409c20ff6b6a9c9f4152fc9fcbf16440fedf02fcacc0fb26ea3b8eab9a860a40" + url: "https://pub.dev" source: hosted version: "7.2.4" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.dartlang.org" + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - url: "https://pub.dartlang.org" + sha256: d7a9cd57c215bdf8d502772447aa6b52a8ab3f956d25d5fdea6ef1df2d2dad60 + url: "https://pub.dev" source: hosted version: "8.4.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + url: "https://pub.dev" source: hosted version: "1.2.1" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.dartlang.org" + sha256: dd007e4fb8270916820a0d66e24f619266b60773cddd082c6439341645af2659 + url: "https://pub.dev" source: hosted version: "2.0.1" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" code_builder: dependency: transitive description: name: code_builder - url: "https://pub.dartlang.org" + sha256: "02ce3596b459c666530f045ad6f96209474e8fee6e4855940a3cee65fb872ec5" + url: "https://pub.dev" source: hosted version: "4.3.0" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.0" colorize: dependency: transitive description: name: colorize - url: "https://pub.dartlang.org" + sha256: "584746cd6ba1cba0633b6720f494fe6f9601c4170f0666c1579d2aa2a61071ba" + url: "https://pub.dev" source: hosted version: "3.0.0" connectivity_plus: dependency: "direct main" description: name: connectivity_plus - url: "https://pub.dartlang.org" + sha256: c5eb92e23b921f7464ff9814a1d294214c11d18aa99d0e5af08b4332eb7edb6d + url: "https://pub.dev" source: hosted version: "2.3.7" connectivity_plus_linux: dependency: transitive description: name: connectivity_plus_linux - url: "https://pub.dartlang.org" + sha256: "3caf859d001f10407b8e48134c761483e4495ae38094ffcca97193f6c271f5e2" + url: "https://pub.dev" source: hosted version: "1.3.1" connectivity_plus_macos: dependency: transitive description: name: connectivity_plus_macos - url: "https://pub.dartlang.org" + sha256: "918e08992649c85bfdb80b07d5de3e17257f776c1db8c76cadabc517f234edee" + url: "https://pub.dev" source: hosted version: "1.2.4" connectivity_plus_platform_interface: dependency: transitive description: name: connectivity_plus_platform_interface - url: "https://pub.dartlang.org" + sha256: cab163c8d1b2327297950f171e962f35300f247b19f0bc52dff48c12762e837e + url: "https://pub.dev" source: hosted version: "1.2.1" connectivity_plus_web: dependency: transitive description: name: connectivity_plus_web - url: "https://pub.dartlang.org" + sha256: b9141dbab92c607758946f2f38eb209d828655dc2535b44b1a9f09c9d4a22fbf + url: "https://pub.dev" source: hosted version: "1.2.3" connectivity_plus_windows: dependency: transitive description: name: connectivity_plus_windows - url: "https://pub.dartlang.org" + sha256: "535b0404b4d5605c4dd8453d67e5d6d2ea0dd36e3b477f50f31af51b0aeab9dd" + url: "https://pub.dev" source: hosted version: "1.2.2" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + sha256: "196284f26f69444b7f5c50692b55ec25da86d9e500451dc09333bf2e3ad69259" + url: "https://pub.dev" source: hosted version: "3.0.2" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + url: "https://pub.dev" source: hosted version: "3.0.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" source: hosted version: "1.0.5" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.dartlang.org" + sha256: "7a03456c3490394c8e7665890333e91ae8a49be43542b616e414449ac358acd4" + url: "https://pub.dev" source: hosted version: "2.2.4" dartz: dependency: "direct main" description: name: dartz - url: "https://pub.dartlang.org" + sha256: e6acf34ad2e31b1eb00948692468c30ab48ac8250e0f0df661e29f12dd252168 + url: "https://pub.dev" source: hosted version: "0.10.1" dbus: dependency: transitive description: name: dbus - url: "https://pub.dartlang.org" + sha256: "6f07cba3f7b3448d42d015bfd3d53fe12e5b36da2423f23838efc1d5fb31a263" + url: "https://pub.dev" source: hosted version: "0.7.8" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted version: "1.3.1" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978 + url: "https://pub.dev" source: hosted version: "2.0.1" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" source: hosted version: "6.1.4" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.dartlang.org" + sha256: "04be3e934c52e082558cc9ee21f42f5c1cd7a1262f4c63cd0357c08d5bba81ec" + url: "https://pub.dev" source: hosted version: "1.0.1" flutter: @@ -283,23 +322,26 @@ packages: dependency: "direct main" description: name: flutter_bloc - url: "https://pub.dartlang.org" + sha256: "890c51c8007f0182360e523518a0c732efb89876cb4669307af7efada5b55557" + url: "https://pub.dev" source: hosted version: "8.1.1" flutter_lints: dependency: "direct dev" description: name: flutter_lints - url: "https://pub.dartlang.org" + sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + url: "https://pub.dev" source: hosted version: "2.0.1" flutter_rust_bridge: dependency: transitive description: name: flutter_rust_bridge - url: "https://pub.dartlang.org" + sha256: "36e11b79ac7011d9203313468c5827fe1215b0fa03df384cfe2891a68ed74ed5" + url: "https://pub.dev" source: hosted - version: "1.60.0" + version: "1.75.3" flutter_test: dependency: "direct dev" description: flutter @@ -314,350 +356,400 @@ packages: dependency: "direct dev" description: name: freezed - url: "https://pub.dartlang.org" + sha256: "73b58fe836dc05594451d8f740d97d5167886962d628b9f60a1fe945aa0a891f" + url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.3.3" freezed_annotation: dependency: transitive description: name: freezed_annotation - url: "https://pub.dartlang.org" + sha256: aeac15850ef1b38ee368d4c53ba9a847e900bb2c53a4db3f6881cbb3cb684338 + url: "https://pub.dev" source: hosted version: "2.2.0" frontend_server_client: dependency: transitive description: name: frontend_server_client - url: "https://pub.dartlang.org" + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" source: hosted version: "3.2.0" get_it: dependency: "direct main" description: name: get_it - url: "https://pub.dartlang.org" + sha256: "290fde3a86072e4b37dbb03c07bec6126f0ecc28dad403c12ffe2e5a2d751ab7" + url: "https://pub.dev" source: hosted version: "7.2.0" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + sha256: c51b4fdfee4d281f49b8c957f1add91b815473597f76bcf07377987f66a55729 + url: "https://pub.dev" source: hosted version: "2.1.0" google_fonts: dependency: "direct main" description: name: google_fonts - url: "https://pub.dartlang.org" + sha256: "8f099045e2f2a30e4d4d0a35f40c6bc941a8f2ca0e10ad9d214ee9edd3f37483" + url: "https://pub.dev" source: hosted version: "3.0.1" graphs: dependency: transitive description: name: graphs - url: "https://pub.dartlang.org" + sha256: ae0b3d956ff324c6f8671f08dcb2dbd71c99cdbf2aa3ca63a14190c47aa6679c + url: "https://pub.dev" source: hosted version: "2.1.0" http: dependency: transitive description: name: http - url: "https://pub.dartlang.org" + sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482" + url: "https://pub.dev" source: hosted version: "0.13.5" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.dartlang.org" + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" source: hosted version: "3.2.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: db3060f22889f3d9d55f6a217565486737037eec3609f7f3eca4d0c67ee0d8a0 + url: "https://pub.dev" source: hosted version: "4.0.1" injectable: dependency: "direct main" description: name: injectable - url: "https://pub.dartlang.org" + sha256: f71eb879124ed286cbd2210337b91ff5f345f146187c1f1891c172e0ac06443a + url: "https://pub.dev" source: hosted version: "1.5.4" injectable_generator: dependency: "direct dev" description: name: injectable_generator - url: "https://pub.dartlang.org" + sha256: "1f5bbe44f06cf15dc55b9797a8df8b4d22b0471f6a7d7f79f4c651393b130a9d" + url: "https://pub.dev" source: hosted version: "1.5.5" intl: dependency: "direct main" description: name: intl - url: "https://pub.dartlang.org" + sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + url: "https://pub.dev" source: hosted version: "0.17.0" io: dependency: transitive description: name: io - url: "https://pub.dartlang.org" + sha256: "0d4c73c3653ab85bf696d51a9657604c900a370549196a91f33e4c39af760852" + url: "https://pub.dev" source: hosted version: "1.0.3" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "0.6.5" json_annotation: dependency: transitive description: name: json_annotation - url: "https://pub.dartlang.org" + sha256: cb314f00b2488de7bc575207e54402cd2f92363f333a7933fd1b0631af226baa + url: "https://pub.dev" source: hosted version: "4.6.0" json_serializable: dependency: "direct dev" description: name: json_serializable - url: "https://pub.dartlang.org" + sha256: fd1bcfbf6f623e1dfcc60616f189a6ca540dba7b5917447be5dab754b3116932 + url: "https://pub.dev" source: hosted version: "6.3.2" lints: dependency: transitive description: name: lints - url: "https://pub.dartlang.org" + sha256: "5cfd6509652ff5e7fe149b6df4859e687fca9048437857cb2e65c8d780f396e3" + url: "https://pub.dev" source: hosted version: "2.0.0" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "293ae2d49fd79d4c04944c3a26dfd313382d5f52e821ec57119230ae16031ad4" + url: "https://pub.dev" source: hosted version: "1.0.2" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + url: "https://pub.dev" source: hosted - version: "0.12.12" + version: "0.12.13" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.1.5" + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + url: "https://pub.dev" source: hosted version: "1.8.0" mime: dependency: transitive description: name: mime - url: "https://pub.dartlang.org" + sha256: dab22e92b41aa1255ea90ddc4bc2feaf35544fd0728e209638cad041a6e3928a + url: "https://pub.dev" source: hosted version: "1.0.2" mockito: dependency: transitive description: name: mockito - url: "https://pub.dartlang.org" + sha256: dd61809f04da1838a680926de50a9e87385c1de91c6579629c3d1723946e8059 + url: "https://pub.dev" source: hosted - version: "5.3.2" + version: "5.4.0" nested: dependency: transitive description: name: nested - url: "https://pub.dartlang.org" + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" source: hosted version: "1.0.0" nm: dependency: transitive description: name: nm - url: "https://pub.dartlang.org" + sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" + url: "https://pub.dev" source: hosted version: "0.5.0" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" source: hosted version: "2.1.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + url: "https://pub.dev" source: hosted version: "1.8.2" path_provider: dependency: "direct main" description: name: path_provider - url: "https://pub.dartlang.org" + sha256: "050e8e85e4b7fecdf2bb3682c1c64c4887a183720c802d323de8a5fd76d372dd" + url: "https://pub.dev" source: hosted version: "2.0.11" path_provider_android: dependency: transitive description: name: path_provider_android - url: "https://pub.dartlang.org" + sha256: "4d5542667150f5b779ba411dd5dc0b674a85d1355e45bda2877e0e82f4ad08d8" + url: "https://pub.dev" source: hosted version: "2.0.20" path_provider_ios: dependency: transitive description: name: path_provider_ios - url: "https://pub.dartlang.org" + sha256: "03d639406f5343478352433f00d3c4394d52dac8df3d847869c5e2333e0bbce8" + url: "https://pub.dev" source: hosted version: "2.0.11" path_provider_linux: dependency: transitive description: name: path_provider_linux - url: "https://pub.dartlang.org" + sha256: ab0987bf95bc591da42dffb38c77398fc43309f0b9b894dcc5d6f40c4b26c379 + url: "https://pub.dev" source: hosted version: "2.1.7" path_provider_macos: dependency: transitive description: name: path_provider_macos - url: "https://pub.dartlang.org" + sha256: "2a97e7fbb7ae9dcd0dfc1220a78e9ec3e71da691912e617e8715ff2a13086ae8" + url: "https://pub.dev" source: hosted version: "2.0.6" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.dartlang.org" + sha256: "27dc7a224fcd07444cb5e0e60423ccacea3e13cf00fc5282ac2c918132da931d" + url: "https://pub.dev" source: hosted version: "2.0.4" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.dartlang.org" + sha256: bcabbe399d4042b8ee687e17548d5d3f527255253b4a639f5f8d2094a9c2b45c + url: "https://pub.dev" source: hosted version: "2.1.3" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.dartlang.org" + sha256: "2ebb289dc4764ec397f5cd3ca9881c6d17196130a7d646ed022a0dd9c2e25a71" + url: "https://pub.dev" source: hosted version: "5.0.0" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + url: "https://pub.dev" source: hosted version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a + url: "https://pub.dev" source: hosted version: "2.1.3" pointycastle: dependency: transitive description: name: pointycastle - url: "https://pub.dartlang.org" + sha256: db7306cf0249f838d1a24af52b5a5887c5bf7f31d8bb4e827d071dc0939ad346 + url: "https://pub.dev" source: hosted version: "3.6.2" pool: dependency: transitive description: name: pool - url: "https://pub.dartlang.org" + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" source: hosted version: "1.5.1" process: dependency: transitive description: name: process - url: "https://pub.dartlang.org" + sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" + url: "https://pub.dev" source: hosted version: "4.2.4" provider: dependency: transitive description: name: provider - url: "https://pub.dartlang.org" + sha256: "8d7d4c2df46d6a6270a4e10404bfecb18a937e3e00f710c260d0a10415ce6b7b" + url: "https://pub.dev" source: hosted version: "6.0.3" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + sha256: "816c1a640e952d213ddd223b3e7aafae08cd9f8e1f6864eed304cc13b0272b07" + url: "https://pub.dev" source: hosted version: "2.1.1" pubspec_parse: dependency: transitive description: name: pubspec_parse - url: "https://pub.dartlang.org" + sha256: "75f6614d6dde2dc68948dffbaa4fe5dae32cd700eb9fb763fe11dfb45a3c4d0a" + url: "https://pub.dev" source: hosted version: "1.2.1" puppeteer: dependency: transitive description: name: puppeteer - url: "https://pub.dartlang.org" + sha256: a1c40c0c341dc1d8d6c318d6cadc7859d40391e1f4553aa31a372a1b13f8e9c0 + url: "https://pub.dev" source: hosted version: "2.15.0" qr: dependency: transitive description: name: qr - url: "https://pub.dartlang.org" + sha256: "5c4208b4dc0d55c3184d10d83ee0ded6212dc2b5e2ba17c5a0c0aab279128d21" + url: "https://pub.dev" source: hosted version: "2.1.0" qr_flutter: dependency: "direct main" description: name: qr_flutter - url: "https://pub.dartlang.org" + sha256: c5c121c54cb6dd837b9b9d57eb7bc7ec6df4aee741032060c8833a678c80b87e + url: "https://pub.dev" source: hosted version: "4.0.0" shelf: dependency: transitive description: name: shelf - url: "https://pub.dartlang.org" + sha256: "8ec607599dd0a78931a5114cdac7d609b6dbbf479a38acc9a6dba024b2a30ea0" + url: "https://pub.dev" source: hosted version: "1.3.2" shelf_static: dependency: transitive description: name: shelf_static - url: "https://pub.dartlang.org" + sha256: e792b76b96a36d4a41b819da593aff4bdd413576b3ba6150df5d8d9996d2e74c + url: "https://pub.dev" source: hosted version: "1.1.1" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.dartlang.org" + sha256: "6db16374bc3497d21aa0eebe674d3db9fdf82082aac0f04dc7b44e4af5b08afc" + url: "https://pub.dev" source: hosted version: "1.0.2" sky_engine: @@ -669,147 +761,168 @@ packages: dependency: transitive description: name: source_gen - url: "https://pub.dartlang.org" + sha256: "0f5cf4243080b2c57650128ac1841498282da5ca1da0e826a03c9e208186c59d" + url: "https://pub.dev" source: hosted version: "1.2.3" source_helper: dependency: transitive description: name: source_helper - url: "https://pub.dartlang.org" + sha256: "3b67aade1d52416149c633ba1bb36df44d97c6b51830c2198e934e3fca87ca1f" + url: "https://pub.dev" source: hosted version: "1.3.3" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.dartlang.org" + sha256: ed464977cb26a1f41537e177e190c67223dbd9f4f683489b6ab2e5d211ec564e + url: "https://pub.dev" source: hosted version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + url: "https://pub.dev" source: hosted - version: "0.4.12" + version: "0.4.16" timing: dependency: transitive description: name: timing - url: "https://pub.dartlang.org" + sha256: c386d07d7f5efc613479a7c4d9d64b03710b03cfaa7e8ad5f2bfb295a1f0dfad + url: "https://pub.dev" source: hosted version: "1.0.0" tuple: dependency: transitive description: name: tuple - url: "https://pub.dartlang.org" + sha256: "0ea99cd2f9352b2586583ab2ce6489d1f95a5f6de6fb9492faaf97ae2060f0aa" + url: "https://pub.dev" source: hosted version: "2.0.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + url: "https://pub.dev" source: hosted version: "1.3.1" uuid: dependency: "direct main" description: name: uuid - url: "https://pub.dartlang.org" + sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" + url: "https://pub.dev" source: hosted - version: "3.0.6" + version: "3.0.7" validators: dependency: "direct main" description: name: validators - url: "https://pub.dartlang.org" + sha256: "884515951f831a9c669a41ed6c4d3c61c2a0e8ec6bca761a4480b28e99cecf5d" + url: "https://pub.dev" source: hosted version: "3.0.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + sha256: e42dfcc48f67618344da967b10f62de57e04bae01d9d3af4c2596f3712a88c99 + url: "https://pub.dev" source: hosted version: "1.0.1" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.dartlang.org" + sha256: "3a969ddcc204a3e34e863d204b29c0752716f78b6f9cc8235083208d268a4ccd" + url: "https://pub.dev" source: hosted version: "2.2.0" win32: dependency: transitive description: name: win32 - url: "https://pub.dartlang.org" + sha256: "1952a663c0e34fbde55916010d54bbb249bf5f2583113c497602f0ee01c6faa4" + url: "https://pub.dev" source: hosted version: "3.0.0" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.dartlang.org" + sha256: "11541eedefbcaec9de35aa82650b695297ce668662bbd6e3911a7fabdbde589f" + url: "https://pub.dev" source: hosted version: "0.2.0+2" xml: dependency: transitive description: name: xml - url: "https://pub.dartlang.org" + sha256: ac0e3f4bf00ba2708c33fbabbbe766300e509f8c82dbd4ab6525039813f7e2fb + url: "https://pub.dev" source: hosted version: "6.1.0" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" + url: "https://pub.dev" source: hosted version: "3.1.1" sdks: diff --git a/pubspec.yaml b/pubspec.yaml index 0a4f740..00758d3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -21,7 +21,10 @@ dependencies: injectable: ^1.5.3 validators: google_fonts: ^3.0.1 - bdk_flutter: ^0.3.0 + bdk_flutter: + git: + url: https://github.com/LtbLightning/bdk-flutter.git + ref: main dev_dependencies: build_runner: ^2.3.2 freezed: ^2.0.3+1 From d3b214ef2f3fcbf8615cc6f2a013ad99321e7942 Mon Sep 17 00:00:00 2001 From: StaxoLotl Date: Thu, 25 May 2023 19:56:00 -0400 Subject: [PATCH 2/2] Add integration tests --- integration_test.sh | 7 + integration_test/create_new_wallet_test.dart | 38 +++++ integration_test/load_wallet_test.dart | 46 +++++ ios/Podfile | 7 + ios/Podfile.lock | 12 +- ios/Runner.xcodeproj/project.pbxproj | 4 +- ios/Runner/Info.plist | 2 + .../connectivity/connectivity_cubit.dart | 7 - .../blockchain/blockchain_service.dart | 3 +- lib/infrastructure/wallet/wallet_service.dart | 68 ++++---- lib/presentaition/core/page_wrapper.dart | 8 +- lib/presentaition/dashboard/home.dart | 1 + .../dashboard/widgets/transaction_list.dart | 42 +++-- lib/presentaition/send/send.dart | 7 +- lib/presentaition/wallet/create_wallet.dart | 27 +-- lib/presentaition/wallet/init_wallet.dart | 2 + pubspec.lock | 158 +++++++++++++++--- pubspec.yaml | 9 +- test/widget_test.dart | 31 ---- test_driver/integration_test.dart | 3 + 20 files changed, 346 insertions(+), 136 deletions(-) create mode 100644 integration_test.sh create mode 100644 integration_test/create_new_wallet_test.dart create mode 100644 integration_test/load_wallet_test.dart delete mode 100644 test/widget_test.dart create mode 100644 test_driver/integration_test.dart diff --git a/integration_test.sh b/integration_test.sh new file mode 100644 index 0000000..fc96d7e --- /dev/null +++ b/integration_test.sh @@ -0,0 +1,7 @@ +flutter drive \ + --driver=test_driver/integration_test.dart \ + --target=integration_test/create_new_wallet_test.dart \ + + flutter drive \ + --driver=test_driver/integration_test.dart \ + --target=integration_test/load_wallet_test.dart \ diff --git a/integration_test/create_new_wallet_test.dart b/integration_test/create_new_wallet_test.dart new file mode 100644 index 0000000..ae85766 --- /dev/null +++ b/integration_test/create_new_wallet_test.dart @@ -0,0 +1,38 @@ +import 'package:bdk_wallet/core/constants/enums.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; +import 'package:bdk_wallet/main.dart' as app; + +void main() { + group('Create wallet test', () { + final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.fullyLive; + testWidgets('full cycle test', (tester) async { + app.main(); + await tester.pumpAndSettle(const Duration(seconds: 3)); + + final createNewWalletButton = find.byKey(const Key('create_new_wallet')); + await tester.tap(createNewWalletButton); + await tester.pumpAndSettle(); + // create wallet page; + final createWalletSubmitButton = + find.byKey(const Key('create_wallet_button')); + final genSeedButton = find.byKey(const Key('gen_seed_button')); + final passwordField = find.byKey(const Key('password_textfield')); + final bitcoinUrlField = find.byKey(const Key('bitcoin_url_textfield')); + await tester.tap(genSeedButton); + await tester.pumpAndSettle(); + await tester.enterText(passwordField, 'password'); + await tester.pumpAndSettle(); + await tester.enterText( + bitcoinUrlField, 'ssl://electrum.blockstream.info:60002'); + await tester.pumpAndSettle(); + await tester.tap(createWalletSubmitButton); + await tester.pumpAndSettle(); + // dashboard page; + final syncButton = find.byKey(const Key('sync_button')); + await tester.tap(syncButton); + }); + }); +} diff --git a/integration_test/load_wallet_test.dart b/integration_test/load_wallet_test.dart new file mode 100644 index 0000000..ba277c8 --- /dev/null +++ b/integration_test/load_wallet_test.dart @@ -0,0 +1,46 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; +import 'package:bdk_wallet/main.dart' as app; + +void main() { + group('Load wallet test', () { + final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.fullyLive; + testWidgets('full cycle test', (tester) async { + app.main(); + await tester.pumpAndSettle(const Duration(seconds: 3)); + + final createNewWalletButton = find.byKey(const Key('create_new_wallet')); + await tester.tap(createNewWalletButton); + await tester.pumpAndSettle(); + // create wallet page; + final createWalletSubmitButton = + find.byKey(const Key('create_wallet_button')); + final mnemonicField = find.byKey(const Key('mnemonic_textfield')); + await tester.enterText(mnemonicField, + 'puppy interest whip tonight dad never sudden response push zone pig patch'); + await tester.pumpAndSettle(); + await tester.tap(createWalletSubmitButton); + await tester.pumpAndSettle(); + // dashboard page; + final syncButton = find.byKey(const Key('sync_button')); + await tester.tap(syncButton); + await tester.pumpAndSettle(const Duration(seconds: 6)); + final sendBottomBarItem = find.byKey(const Key('Send')); + await tester.tap(sendBottomBarItem); + await tester.pumpAndSettle(const Duration(seconds: 4)); + // send page; + final addressField = find.byKey(const Key('address_text_field')); + final amountField = find.byKey(const Key('amount_text_field')); + final sendBtcButton = find.byKey(const Key('send_btc_button')); + await tester.enterText( + addressField, "mv4rnyY3Su5gjcDNzbMLKBQkBicCtHUtFB"); + await tester.pumpAndSettle(); + await tester.enterText(amountField, '1000'); + await tester.pumpAndSettle(); + await tester.tap(sendBtcButton); + await tester.pumpAndSettle(const Duration(seconds: 6)); + }); + }); +} diff --git a/ios/Podfile b/ios/Podfile index a7e4a22..2c4ebee 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -37,4 +37,11 @@ post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) end + installer.generated_projects.each do |project| + project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0' + end + end + end end diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 936b05e..8536a52 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,10 +1,12 @@ PODS: - - bdk_flutter (0.3.0): + - bdk_flutter (0.28.1): - Flutter - connectivity_plus (0.0.1): - Flutter - ReachabilitySwift - Flutter (1.0.0) + - integration_test (0.0.1): + - Flutter - path_provider_ios (0.0.1): - Flutter - ReachabilitySwift (5.0.0) @@ -13,6 +15,7 @@ DEPENDENCIES: - bdk_flutter (from `.symlinks/plugins/bdk_flutter/ios`) - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) - Flutter (from `Flutter`) + - integration_test (from `.symlinks/plugins/integration_test/ios`) - path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`) SPEC REPOS: @@ -26,16 +29,19 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/connectivity_plus/ios" Flutter: :path: Flutter + integration_test: + :path: ".symlinks/plugins/integration_test/ios" path_provider_ios: :path: ".symlinks/plugins/path_provider_ios/ios" SPEC CHECKSUMS: - bdk_flutter: e07886d29c53a9c7deba3bec3b20418ce5bd9787 + bdk_flutter: e571a4dff5d36cab3068c804bde44fbd521a0972 connectivity_plus: 413a8857dd5d9f1c399a39130850d02fe0feaf7e Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + integration_test: a1e7d09bd98eca2fc37aefd79d4f41ad37bdbbe5 path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02 ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 -PODFILE CHECKSUM: 7d714a5ac7fda1315bc261738086cf00fa98c7e3 +PODFILE CHECKSUM: 7ed12c9564b62b763e516c5fa465dc960f533e28 COCOAPODS: 1.11.3 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index d34a2e3..bc39dd3 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -222,6 +222,7 @@ }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -236,6 +237,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index ac78e00..c11ffe2 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -45,5 +45,7 @@ CADisableMinimumFrameDurationOnPhone + UIApplicationSupportsIndirectInputEvents + diff --git a/lib/application/connectivity/connectivity_cubit.dart b/lib/application/connectivity/connectivity_cubit.dart index a9d5d1b..019f930 100644 --- a/lib/application/connectivity/connectivity_cubit.dart +++ b/lib/application/connectivity/connectivity_cubit.dart @@ -4,7 +4,6 @@ import 'package:bloc/bloc.dart'; import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:injectable/injectable.dart'; -import 'package:meta/meta.dart'; import '../../core/constants/enums.dart'; import '../../domain/connectivity/i_connectivity_service.dart'; @@ -33,10 +32,4 @@ class ConnectivityCubit extends Cubit { void emitConnected(ConnectionType type) => emit(Connected(type)); void emitDisconnected() => emit(Disconnected()); - - @override - Future close() { - connectivitySubscription.cancel(); - return super.close(); - } } diff --git a/lib/infrastructure/blockchain/blockchain_service.dart b/lib/infrastructure/blockchain/blockchain_service.dart index d8c5a1d..02437f7 100644 --- a/lib/infrastructure/blockchain/blockchain_service.dart +++ b/lib/infrastructure/blockchain/blockchain_service.dart @@ -26,7 +26,8 @@ class BlockchainService extends IBlockchainService { Future> broadcastTransaction( {required PartiallySignedTransaction psbt}) async { try { - await _blockchain!.broadcast(psbt); + final tx = await psbt.extractTx(); + await _blockchain!.broadcast(tx); return const Right(unit); } on Exception catch (_) { return const Left(BlockchainFailure.unexpected()); diff --git a/lib/infrastructure/wallet/wallet_service.dart b/lib/infrastructure/wallet/wallet_service.dart index e534bff..895393b 100644 --- a/lib/infrastructure/wallet/wallet_service.dart +++ b/lib/infrastructure/wallet/wallet_service.dart @@ -1,31 +1,37 @@ import 'dart:convert'; + import 'package:bdk_flutter/bdk_flutter.dart'; import 'package:bdk_wallet/domain/wallet/failure/wallet_failure.dart'; import 'package:bdk_wallet/domain/wallet/interface/i_wallet_Service.dart'; import 'package:bdk_wallet/infrastructure/wallet/dto/wallet_dto.dart'; import 'package:dartz/dartz.dart'; import 'package:injectable/injectable.dart'; + import '../core/source/local.dart'; @LazySingleton(as: IWalletService) class WalletService extends IWalletService { Wallet? _wallet; - Future> checkIfWalletSaved(WalletDto walletDto) async{ + Future> checkIfWalletSaved(WalletDto walletDto) async { final wallets = await getAllWallets(); - final res = wallets.map((e) => e.mnemonic).toList(); - if(res.contains(walletDto.mnemonic)){ + final res = wallets.map((e) => e.mnemonic).toList(); + if (res.contains(walletDto.mnemonic)) { return wallets; - } else{ + } else { wallets.add(walletDto); return wallets; } } + @override - Future> createWallet({required WalletDto walletDto}) async { + Future> createWallet( + {required WalletDto walletDto}) async { try { - final descriptor = await createDescriptorSecret(walletDto, KeychainKind.External ); - final changeDescriptor = await createDescriptorSecret(walletDto,KeychainKind.Internal ); + final descriptor = + await createDescriptorSecret(walletDto, KeychainKind.External); + final changeDescriptor = + await createDescriptorSecret(walletDto, KeychainKind.Internal); final wallets = await checkIfWalletSaved(walletDto); await writeWallet(wallets); _wallet = await Wallet.create( @@ -38,12 +44,13 @@ class WalletService extends IWalletService { return const Left(WalletFailure.unexpected()); } } + Future writeWallet(List walletDtos) async { final wallets = []; - for ( var e in walletDtos){ + for (var e in walletDtos) { wallets.add(jsonEncode(e.toJson())); } - final res = await Persist().writeToFile("${wallets.toString()}", "wallets"); + final res = await Persist().writeToFile("${wallets.toString()}", "wallets"); return res; } @@ -54,16 +61,20 @@ class WalletService extends IWalletService { @override Future> getAllWallets() async { - final res = await Persist().readFromFile("wallets") ; - if(res==''){ + final res = await Persist().readFromFile("wallets"); + if (res == '') { return []; - } else{ + } else { final wallets = jsonDecode(res) as List; - final walletMaps = wallets.cast>().map((map) => map.cast()).toList(); - final walletDtos= walletMaps.map((e) => WalletDto.fromJson(e)).toList(); + final walletMaps = wallets + .cast>() + .map((map) => map.cast()) + .toList(); + final walletDtos = walletMaps.map((e) => WalletDto.fromJson(e)).toList(); return walletDtos; } } + @override Future> genSeed() async { try { @@ -87,9 +98,9 @@ class WalletService extends IWalletService { @override Future>> - getConfirmedTransactions() async { + getConfirmedTransactions() async { try { - final response = await _wallet!.listTransactions(); + final response = await _wallet!.listTransactions(true); return Right(response); } on Exception catch (e) { return const Left(WalletFailure.noTransactions()); @@ -100,7 +111,7 @@ class WalletService extends IWalletService { Future> getNewAddress() async { try { final response = - await _wallet!.getAddress(addressIndex: AddressIndex.New); + await _wallet!.getAddress(addressIndex: const AddressIndex()); return Right(response.address); } on Exception catch (_) { return const Left(WalletFailure.unexpected()); @@ -109,9 +120,9 @@ class WalletService extends IWalletService { @override Future>> - getPendingTransactions() async { + getPendingTransactions() async { try { - final response = await _wallet!.listTransactions(); + final response = await _wallet!.listTransactions(true); return Right(response); } on Exception catch (e) { return const Left(WalletFailure.noTransactions()); @@ -131,8 +142,8 @@ class WalletService extends IWalletService { @override Future> getLastUsedAddress() async { try { - final response = - await _wallet!.getAddress(addressIndex: AddressIndex.LastUnused); + final response = await _wallet! + .getAddress(addressIndex: const AddressIndex.lastUnused()); return Right(response.address); } on Exception catch (_) { return const Left(WalletFailure.unexpected()); @@ -149,7 +160,7 @@ class WalletService extends IWalletService { .addRecipient(script, amount) .feeRate(1.5) .finish(_wallet!); - final response = await _wallet!.sign(sbt); + final response = await _wallet!.sign(psbt: sbt.psbt); return Right(response.psbtBase64); } on Exception catch (_) { return const Left(WalletFailure.unexpected()); @@ -157,15 +168,16 @@ class WalletService extends IWalletService { } } - -Future createDescriptorSecret(WalletDto walletDto, KeychainKind keyChainKind) async { +Future createDescriptorSecret( + WalletDto walletDto, KeychainKind keyChainKind) async { final mnemonic = await Mnemonic.fromString(walletDto.mnemonic); final descriptorSecretKey = await DescriptorSecretKey.create( network: walletDto.network, mnemonic: mnemonic, - password: walletDto.password - ); - final descriptor = await Descriptor.newBip84(secretKey: descriptorSecretKey, network: walletDto.network, keychain: keyChainKind); + password: walletDto.password); + final descriptor = await Descriptor.newBip84( + secretKey: descriptorSecretKey, + network: walletDto.network, + keychain: keyChainKind); return descriptor; } - diff --git a/lib/presentaition/core/page_wrapper.dart b/lib/presentaition/core/page_wrapper.dart index 2260ce0..c0c58df 100644 --- a/lib/presentaition/core/page_wrapper.dart +++ b/lib/presentaition/core/page_wrapper.dart @@ -39,12 +39,7 @@ class _PageWrapperState extends State { controller: pageController, physics: const NeverScrollableScrollPhysics(), onPageChanged: pageChanged, - children: const [ - Home(), - Send(), - Receive(), - LoadBdkWallet() - ], + children: const [Home(), Send(), Receive(), LoadBdkWallet()], ), ), floatingActionButton: FloatingActionButton( @@ -130,6 +125,7 @@ class _PageWrapperState extends State { Widget bottomAppBarItem( String label, int index, int selectedIndex, Icon? icon) { return GestureDetector( + key: Key(label), onTap: () { bottomTapped(index); }, diff --git a/lib/presentaition/dashboard/home.dart b/lib/presentaition/dashboard/home.dart index 78cc83c..0ebe15a 100644 --- a/lib/presentaition/dashboard/home.dart +++ b/lib/presentaition/dashboard/home.dart @@ -63,6 +63,7 @@ class _HomeState extends State { centerTitle: false, actions: [ IconButton( + key: const Key('sync_button'), onPressed: () { context.read().add(WalletEvent.sync( blockchainBloc diff --git a/lib/presentaition/dashboard/widgets/transaction_list.dart b/lib/presentaition/dashboard/widgets/transaction_list.dart index 7849cfb..ae066e1 100644 --- a/lib/presentaition/dashboard/widgets/transaction_list.dart +++ b/lib/presentaition/dashboard/widgets/transaction_list.dart @@ -18,16 +18,17 @@ class _TransactionListState extends State { Widget build(BuildContext context) { return BlocConsumer( listener: (context, state) { - state.walletFailureOrSuccessOption.fold(() => Navigator.of(context) - .pushReplacementNamed(Routes.wrapper), (a) => - a.fold((l) { - final snackBar = SnackBar( - content: Text(l.toString() ,style: const TextStyle(fontSize: 13, color: Colors.white),), - - ); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - }, - (r) => null )); + state.walletFailureOrSuccessOption.fold( + () => Navigator.of(context).pushReplacementNamed(Routes.wrapper), + (a) => a.fold((l) { + final snackBar = SnackBar( + content: Text( + l.toString(), + style: const TextStyle(fontSize: 13, color: Colors.white), + ), + ); + ScaffoldMessenger.of(context).showSnackBar(snackBar); + }, (r) => null)); }, listenWhen: (p, q) => p.isSubmitting != q.isSubmitting, builder: (context, state) { @@ -41,23 +42,20 @@ class _TransactionListState extends State { padding: const EdgeInsets.only(top: 50), child: (state.walletEntity!.transactions != null) ? ListView.builder( + key: const Key('transaction_list_view'), shrinkWrap: true, reverse: true, physics: const NeverScrollableScrollPhysics(), itemCount: state.walletEntity!.transactions?.length, itemBuilder: (context, index) => TransactionTile( - txId: state - .walletEntity!.transactions![index].txid, - fees: state - .walletEntity!.transactions![index].fee - .toString(), - sent: state - .walletEntity!.transactions![index].sent - , - received: state - .walletEntity!.transactions![index].received - - )) + txId: + state.walletEntity!.transactions![index].txid, + fees: state.walletEntity!.transactions![index].fee + .toString(), + sent: + state.walletEntity!.transactions![index].sent, + received: state + .walletEntity!.transactions![index].received)) : Text('No Transactions Found', style: GoogleFonts.montserrat( fontSize: 15, diff --git a/lib/presentaition/send/send.dart b/lib/presentaition/send/send.dart index 33e9273..062a848 100644 --- a/lib/presentaition/send/send.dart +++ b/lib/presentaition/send/send.dart @@ -125,6 +125,7 @@ class _SendState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ TextFormField( + key: const Key('address_text_field'), controller: _address, validator: (value) { if (value == null || @@ -167,6 +168,7 @@ class _SendState extends State { height: 10, ), TextFormField( + key: const Key('amount_text_field'), keyboardType: const TextInputType.numberWithOptions(), controller: _amount, @@ -208,6 +210,7 @@ class _SendState extends State { height: 10, ), GestureDetector( + key: const Key('send_btc_button'), onTap: () { _formKey.currentState?.save(); (_formKey.currentState!.validate()) @@ -216,8 +219,8 @@ class _SendState extends State { WalletEvent.createAndSign( _address.text, int.parse(_amount.text))), - // _address.clear(), - // _amount.clear(), + _address.clear(), + _amount.clear(), } : ScaffoldMessenger.of(context) .showSnackBar(SnackBar( diff --git a/lib/presentaition/wallet/create_wallet.dart b/lib/presentaition/wallet/create_wallet.dart index 24da5d5..9ddd86f 100644 --- a/lib/presentaition/wallet/create_wallet.dart +++ b/lib/presentaition/wallet/create_wallet.dart @@ -17,16 +17,17 @@ class CreateBdkWallet extends StatelessWidget { Widget build(BuildContext context) { return BlocConsumer( listener: (context, state) { - state.walletFailureOrSuccessOption.fold(() => Navigator.of(context) - .pushReplacementNamed(Routes.wrapper), (a) => - a.fold((l) { - final snackBar = SnackBar( - content: Text(l.toString() ,style: const TextStyle(fontSize: 13, color: Colors.white),), - - ); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - }, - (r) => null )); + state.walletFailureOrSuccessOption.fold( + () => Navigator.of(context).pushReplacementNamed(Routes.wrapper), + (a) => a.fold((l) { + final snackBar = SnackBar( + content: Text( + l.toString(), + style: const TextStyle(fontSize: 13, color: Colors.white), + ), + ); + ScaffoldMessenger.of(context).showSnackBar(snackBar); + }, (r) => null)); }, listenWhen: (p, q) => p.isSubmitting != q.isSubmitting, buildWhen: (p, q) => p.isSubmitting != q.isSubmitting, @@ -144,6 +145,7 @@ class SignInFormState extends State { child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: < Widget>[ TextFormField( + key: const Key('mnemonic_textfield'), controller: mnemonic, onChanged: (value) => walletBloc.add(WalletEvent.mnemonicChanged(MnemonicStr(value))), @@ -173,6 +175,7 @@ class SignInFormState extends State { color: Colors.black.withOpacity(.4)), floatingLabelBehavior: FloatingLabelBehavior.always, suffixIcon: IconButton( + key: const Key('gen_seed_button'), focusColor: Colors.blue, icon: const Icon( CupertinoIcons.arrow_2_circlepath, @@ -188,6 +191,7 @@ class SignInFormState extends State { height: 10, ), TextFormField( + key: const Key('password_textfield'), onChanged: (value) => walletBloc.add(WalletEvent.passwordChanged(value)), style: GoogleFonts.montserrat( @@ -221,6 +225,7 @@ class SignInFormState extends State { height: 10, ), TextFormField( + key: const Key('bitcoin_url_textfield'), onChanged: (value) => blockchainBloc.add( BlockchainEvent.blockChainUrlChanged(BlockchainUrl(value))), validator: (_) => blockchainBloc @@ -260,6 +265,7 @@ class SignInFormState extends State { height: 10, ), DropdownButton( + key: const Key('blockchain_drop_down'), borderRadius: BorderRadius.circular(10), isExpanded: true, alignment: AlignmentDirectional.centerStart, @@ -280,6 +286,7 @@ class SignInFormState extends State { height: 20, ), GestureDetector( + key: const Key('create_wallet_button'), onTap: () { if (walletBloc.state.walletEntity!.mnemonic!.isValid()) { walletBloc.add(const WalletEvent.createWallet()); diff --git a/lib/presentaition/wallet/init_wallet.dart b/lib/presentaition/wallet/init_wallet.dart index 5689300..d585139 100644 --- a/lib/presentaition/wallet/init_wallet.dart +++ b/lib/presentaition/wallet/init_wallet.dart @@ -57,6 +57,7 @@ class InitWallet extends StatelessWidget { const Spacer(), const SizedBox(height: 10), CupertinoButton( + key: const Key('create_new_wallet'), color: Colors.black, padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 15), onPressed: () { @@ -73,6 +74,7 @@ class InitWallet extends StatelessWidget { ), const SizedBox(height: 10), CupertinoButton( + key: const Key('load_wallet'), color: Colors.black, padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 15), onPressed: () { diff --git a/pubspec.lock b/pubspec.lock index 37ba4c6..82166b8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -21,10 +21,10 @@ packages: dependency: transitive description: name: archive - sha256: d6347d54a2d8028e0437e3c099f66fdb8ae02c4720c1e7534c9f24c10351f85d + sha256: "80e5141fafcb3361653ce308776cfd7d45e6e9fbb429e14eec571382c0c5fecb" url: "https://pub.dev" source: hosted - version: "3.3.6" + version: "3.3.2" args: dependency: transitive description: @@ -44,19 +44,28 @@ packages: bdk_flutter: dependency: "direct main" description: - name: bdk_flutter - sha256: "951976492ca658908798a183699b48e2f62c5c8235f398de04a869a02eb3cf54" - url: "https://pub.dev" - source: hosted - version: "0.28.0" + path: "." + ref: main + resolved-ref: d176040c895030b717c6d59282e5ac818fcc8634 + url: "https://github.com/LtbLightning/bdk-flutter.git" + source: git + version: "0.28.1" bloc: dependency: transitive description: name: bloc - sha256: bd4f8027bfa60d96c8046dec5ce74c463b2c918dce1b0d36593575995344534a + sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" + url: "https://pub.dev" + source: hosted + version: "8.1.2" + bloc_test: + dependency: "direct main" + description: + name: bloc_test + sha256: "5f41a3e391c89ccdade81a96233e1e5e5d01564e29e5fe180741fb23579399b9" url: "https://pub.dev" source: hosted - version: "8.1.0" + version: "9.1.2" boolean_selector: dependency: transitive description: @@ -241,6 +250,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.2" + coverage: + dependency: transitive + description: + name: coverage + sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097" + url: "https://pub.dev" + source: hosted + version: "1.6.3" crypto: dependency: transitive description: @@ -281,6 +298,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.8" + diff_match_patch: + dependency: transitive + description: + name: diff_match_patch + sha256: "2efc9e6e8f449d0abe15be240e2c2a3bcd977c8d126cfd70598aee60af35c0a4" + url: "https://pub.dev" + source: hosted + version: "0.4.1" fake_async: dependency: transitive description: @@ -326,6 +351,11 @@ packages: url: "https://pub.dev" source: hosted version: "8.1.1" + flutter_driver: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" flutter_lints: dependency: "direct dev" description: @@ -376,6 +406,11 @@ packages: url: "https://pub.dev" source: hosted version: "3.2.0" + fuchsia_remote_debug_protocol: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" get_it: dependency: "direct main" description: @@ -448,6 +483,11 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.5" + integration_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" intl: dependency: "direct main" description: @@ -544,6 +584,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.4.0" + mocktail: + dependency: transitive + description: + name: mocktail + sha256: "80a996cd9a69284b3dc521ce185ffe9150cde69767c2d3a0720147d93c0cef53" + url: "https://pub.dev" + source: hosted + version: "0.3.0" nested: dependency: transitive description: @@ -560,6 +608,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.0" + node_preamble: + dependency: transitive + description: + name: node_preamble + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" + source: hosted + version: "2.0.2" package_config: dependency: transitive description: @@ -656,14 +712,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.3" - pointycastle: - dependency: transitive - description: - name: pointycastle - sha256: db7306cf0249f838d1a24af52b5a5887c5bf7f31d8bb4e827d071dc0939ad346 - url: "https://pub.dev" - source: hosted - version: "3.6.2" pool: dependency: transitive description: @@ -736,14 +784,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.2" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" + source: hosted + version: "3.0.2" shelf_static: dependency: transitive description: name: shelf_static - sha256: e792b76b96a36d4a41b819da593aff4bdd413576b3ba6150df5d8d9996d2e74c + sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" shelf_web_socket: dependency: transitive description: @@ -773,6 +829,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.3" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + source_maps: + dependency: transitive + description: + name: source_maps + sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" + url: "https://pub.dev" + source: hosted + version: "0.10.12" source_span: dependency: transitive description: @@ -813,6 +885,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + sync_http: + dependency: transitive + description: + name: sync_http + sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" + url: "https://pub.dev" + source: hosted + version: "0.3.1" term_glyph: dependency: transitive description: @@ -821,6 +901,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.1" + test: + dependency: transitive + description: + name: test + sha256: a5fcd2d25eeadbb6589e80198a47d6a464ba3e2049da473943b8af9797900c2d + url: "https://pub.dev" + source: hosted + version: "1.22.0" test_api: dependency: transitive description: @@ -829,6 +917,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.4.16" + test_core: + dependency: transitive + description: + name: test_core + sha256: "0ef9755ec6d746951ba0aabe62f874b707690b5ede0fecc818b138fcc9b14888" + url: "https://pub.dev" + source: hosted + version: "0.4.20" timing: dependency: transitive description: @@ -877,6 +973,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: e7fb6c2282f7631712b69c19d1bff82f3767eea33a2321c14fa59ad67ea391c7 + url: "https://pub.dev" + source: hosted + version: "9.4.0" watcher: dependency: transitive description: @@ -893,6 +997,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.0" + webdriver: + dependency: transitive + description: + name: webdriver + sha256: ef67178f0cc7e32c1494645b11639dd1335f1d18814aa8435113a92e9ef9d841 + url: "https://pub.dev" + source: hosted + version: "3.0.1" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + sha256: "67d3a8b6c79e1987d19d848b0892e582dbb0c66c57cc1fef58a177dd2aa2823d" + url: "https://pub.dev" + source: hosted + version: "1.2.0" win32: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 00758d3..47ddf5d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -25,19 +25,16 @@ dependencies: git: url: https://github.com/LtbLightning/bdk-flutter.git ref: main + bloc_test: ^9.1.2 dev_dependencies: build_runner: ^2.3.2 freezed: ^2.0.3+1 injectable_generator: ^1.5.3 json_serializable: ^6.2.0 + integration_test: + sdk: flutter flutter_test: sdk: flutter - - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. flutter_lints: ^2.0.0 # For information on the generic Dart part of this file, see the diff --git a/test/widget_test.dart b/test/widget_test.dart deleted file mode 100644 index 8816539..0000000 --- a/test/widget_test.dart +++ /dev/null @@ -1,31 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility in the flutter_test package. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:bdk_wallet/presentaition/core/app_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:bdk_wallet/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(const BdkWalletApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -} diff --git a/test_driver/integration_test.dart b/test_driver/integration_test.dart new file mode 100644 index 0000000..7db05c0 --- /dev/null +++ b/test_driver/integration_test.dart @@ -0,0 +1,3 @@ +import 'package:integration_test/integration_test_driver.dart'; + +void main() => integrationDriver();