Commit Graph

30 Commits

Author SHA1 Message Date
Alex b84df3d9dc
[#592] Instrumentation coverage
Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2023-01-17 14:54:40 -05:00
Carter Jernigan 4f144405c1
[#708] Fix seed byte generation 2023-01-17 11:44:57 -05:00
Alex 88c7277048
[#161] Implement display of new address types
Co-authored-by: Honza <rychnovsky.honza@gmail.com>
2023-01-09 07:57:22 -05:00
Honza Rychnovsky e71c7854a9
[#642] Adopt SDK 1.10.0 API changes
* Adopt SDK 1.10.0 API changes

* Rename ShieldedSapling -> LegacySapling

* Viewing key re-derived for fix fixture value

* Changes used API for retrieving Transparent address

- Switched API DerivationTool.deriveTransparentAddress() -> Synchronizer.getLegacyTransparentAddress()
- Renamed Transparent -> LegacyTransparent

* Adds new common transaction model class

- Synchronizer.toTransactions() now works only with clearedTransactions and pendingTransactions
-Added CommonTransaction wrapper for all attributes of PendingTransaction and TransactionOverview to cover as much as possible. It's prepared for discussion about which attributes we really need and which we can omit.

* Regeneration of addresses in fixture

- Applies for both Transparent and Sapling addresses
- Fixed related test
- Added a new test for checking Transparent address abbreviation, as it also serves as a little check of the fixture address and can prevent an incorrect address change in the future

* Remove Viewing key usage from entire app

- As we agreed that the app should not access to it now
- Removed from all related places

* Change CommonTransaction to sealed class

* Comments update

* Switch SDK to 1.10.0-beta01-SNAPSHOT version

* Revert back legacy naming on Transparent and Sapling addresses

* Increased timeout limit to satisfy SDK initialization

* Remove unused import
2022-11-25 09:30:27 +01:00
Carter Jernigan 45d90b7706 [#586] AGP 7.3 2022-09-22 16:06:09 -04:00
Carter Jernigan a48b18e1be
[#556] Adopt SDK 1.9 ZcashNetwork API 2022-08-04 11:56:50 -04:00
Carter Jernigan f9afd2e5f9
[#536] Adopt BlockHeight API (#537)
Note that this change modifies the on-disk representation of the wallet.  Anyone who has an earlier build install will see a runtime crash.  This is expected, as we are not supporting data migrations at this stage of development.  The solution is to uninstall/reinstall the app.
2022-07-26 10:46:23 -04:00
Honza Rychnovsky 32c20953f7
[#310] [Scaffold] Progress Status Circular Bar
* [#310] [Scaffold] Progress Status Circular Bar

- Added Z to Home ZECs balance
- Added USD balance text to Home
- Prepared Text extension functions for both
- Provided Zatoshi to USD conversion methods + filed related SDK conversion issue

* Update Home screen UI with progress bars

- Implemented scaffolding UI of progress bars
- Added related texts to strings

* Update Home screen UI with progress bars

- Connected some of the implemented UI elements to SDK values
- Added app update information to Home screen
- Update WalletSnapshot with progress field

* Update Home screen UI with progress bars

- Capturing and handling errors from SDK Synchronizer.
- Added related error strings.
-  Simplified Home screen UI.

* Zboto font added. Load it in runtime. Import to Typography.

* Updated ZEC sign icon.

* Draw ZEC balance with Zboto font

* Simplify Home screen balances assigning

* Switch to PercentDecimal progress representatiton

* Support different locales while working with fiat currency

* Fix bug in checking of fiat currency value

* Generalize strings to provide possibility of other fiat currencies

* Add fiat currency conversion states mechanism

* Add TODO comment with reference to follow up SynchronizerError issue

* Add WalletDisplayValues to simplify HomeView composable

* Add CurrencyConversion class for connection to Price API (and convert Zatoshi to fiat currency)

* Add basic HomeView tests

* Add basic HomeViewIntegration test

* Review changes

- Used Duration API for times
 - Allow injecting clock into currency conversion
 - Moved FiatCurrencyConversionRateState to sdk-ext-ui because I suspect that we’ll consider this to be a UI object.  I based this on the fact that current/stale cutoff values are arbitrary and probably should be the domain of the UI rather than the SDK.
 - Added some tests, although additional coverage is needed
 - Added fixtures for model objects

* Minor code refactoring

- Move UpdateInfoFixture class to fixture dir
- Remove unnecessary annotation
- Add common application context method to test suite
- Fix Test class import
- Move several WalletSnapshotFixture parameters to const fields

* Add WalletDisplayValuesTest to cover the model class.

* Fix import after changes merged

* Use the new MonetarySeparatorsFixture in related tests

* Add a few basic Zatoshi -> USD conversion tests

* Turn on core lib desugaring for sdk-ext-ui-lib module

* Make WalletDisplayValues a data class

I think there may be some instances where this can help with recomposition

* Add preference key for fiat currency

This allows us to configure reading the value with observers correctly, even if we don’t allow the user to change it right now.

* Delegate symbol and formatting to JVM

* Add tests for Locale

Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2022-07-13 09:16:05 +02:00
Carter Jernigan 0ffaab953b
[#510] Consume Zatoshi from SDK (#514)
Co-authored-by: Honza <rychnovsky.honza@gmail.com>
2022-06-23 07:31:16 -04:00
Carter Jernigan 45aff80e76
[#511] Ktlint 0.46.1 2022-06-22 05:48:19 -04:00
Carter Jernigan 6540cd6bd3 [#482] Rename build-convention to build-conventions-secant
This prevents naming conflicts with included builds across multiple projects with build conventions.
2022-06-14 18:20:51 -04:00
Honza Rychnovsky 0023eb287a
[#430] Crash Intel 64-bit Emulators
* [#430] App crashes on Intel x86_64 emulators

- Bump the SDK version to the latest snapshot version.
- Set app's max Android SDK version to 31 for wtf emulators.
- Remove overridden wtf emulators config from sdk-ext-lib module.
2022-06-07 07:24:45 +02:00
Carter Jernigan 9267e75cb8
[#303] Write crash logs on external storage (#429)
- Added automatic exception logging, registered in the Application object
 - The design sends the exception to a second process, as the main process could be in a bad state when crashing. If we ever encounter problems with this design, it is easily toggleable to turn off with a boolean resource
 - Reading the process name is a bit complex on older Android versions, so we leverage a ContentProvider (which runs prior to Application.onCreate()) to get the process name
 - Added a simple logging mechanism for multiprocess and multithread log messages
 - Refactored spackle-lib into spackle-lib (multiplatform) and spackle-android-lib

Co-authored-by: Honza <rychnovsky.honza@gmail.com>
2022-05-31 12:38:02 -04:00
Carter Jernigan a8be47bf89
[#433] Use emulator.wtf for tests on CI (#428)
This should speed up our builds and reduce flakiness.

Followup items:
 - Enable coverage
 - Collect screenshots
 - Fix target API on sdk-ext-lib #430
2022-05-17 10:06:56 -04:00
Carter Jernigan 4f960d5bf8
[#6] Refactor kotlinOptions to build-conventions 2022-05-17 06:06:44 -04:00
Carter Jernigan 3e67fda537
[#394] Kotlin 1.6.20
Also updated the Compose compiler to be compatible
2022-04-22 10:57:56 -04:00
Honza Rychnovsky 4e5e5c4ab7
[#223] fromZecString reject bad input.
- Implementing regex solution for validation of input ZecAmount after confirm button is pressed.
- Added also unit tests for this new feature.
- Move necessary components from sdk-ext-lib to sdk-ext-ui module.
- Align implementation with comments form PR.
- Fix name of run configuration.
- Ensure consistent behavior of tests.
2022-04-08 14:33:08 +02:00
Honza Rychnovsky db13435d52
[#218] Prevent illegal number on ZEC amount
- Prevent illegal input in ZEC Send/Request form.
- New SDL-EXT-UI module for UI related SDK helper components.
- Regex for continuous validation of the entered ZEC amount.
- Added a new unit tests for validation of the regex too.
- Using the regex on ZEC Request and ZEC Send screens.
- Updated existing and created a new UI tests for validating entered ZEC amount values on Request and Send screens.
- Improve code to be validated with DetektAll static analyzation.
- Architecture documentation update with the newly added sdk-ext-ui module.
- Added run configuration sdk-ext-lib:connectedCheck for AS.
- Added check for digits count between grouping separators + tests.
- Refactoring test class name and its separator value.
2022-04-01 16:28:16 +02:00
Honza Rychnovsky 39949d8632
[#283] Kotlin API for Zcash URI parser
- Includes Zip321UriBuildFixture for the toUri() method from the Rust layer.
- Includes Zip321UriParseFixture for the fromUri() method from the Rust layer.
- Added ZecRequestTest class for testing ZecRequest methods.
- Align Zip321UriBuildFixture and Zip321UriParseFixture parameters.
- Added comments to the new() methods of Zip321BuildFixture and Zip321ParseFixture.
2022-03-30 14:16:57 +02:00
Carter Jernigan 45e14e6a4b [#173] Adopt SDK API changes
This allows the app to consume the snapshot version of the SDK, which contains a number of API changes.

A followup issue of #279 was filed so that the app can be reverted to the release version of the SDK once the SDK API stabilizes again.
2022-03-16 13:00:13 -04:00
Carter Jernigan 3d4f9fb4b4
[#142] Send ZEC scaffold (#253)
Implements a basic scaffold for sending ZEC.

Some new model objects and an extension method were added that I hope to move to the SDK.

Followup issues include
 - Press-and-hold for the Send button #249
 - Prevent illegal input in input form #218
 - Prevent undefined behavior if locale changes #217
 - Add error handling to the Zec send screen #250
 - Add confirmation after send is created #252
2022-03-01 08:11:23 -05:00
Carter Jernigan a1199e706e
[#135] Request ZEC scaffold 2022-02-17 08:08:06 -05:00
Carter Jernigan 52588e6bd3
[#191] Background sync
Preliminary and limited version of background sync, with the following limitations
 - Sync is always enabled
 - Default sync period is 24 hours and is not updated once the wallet is created

This change refactors the synchronizer to a global singleton that both WorkManager and the UI can interact with.
2022-02-04 07:37:08 -05:00
Carter Jernigan d46cf8187c
[#145] Profile scaffold 2022-01-13 12:49:08 -05:00
Carter Jernigan eb550f680e [#166] Included build for SDK development
Note that the SDK master branch contains breaking API changes, which the Secant app hasn't yet been updated to support, so enabling an included build will have compile failures.
2022-01-04 16:20:37 -05:00
Carter Jernigan ee96e915ae
[#62] Wallet details scaffold
Implements a details screen showing various wallet addresses

Some known issues requiring followup in future pull requests:
 - #159 Colors for light theme have not been defined yet
 - #160 Color blocks have 2x borders along the top/bottom of the middle item
 - #161 Some address types display placeholder values
2021-12-31 08:28:16 -05:00
Carter Jernigan 205344c201
[#12] Home screen scaffold (#158)
This provides a very basic scaffold of the home screen and navigation to other child screens.  Additional work needs to be done in both the SDK and this app to build all of the functionality.  Specific known gaps
 - Displaying synchronization status to the user, pending full designs on the progress and animation behaviors
 - Improved APIs for listing and filtering transactions.  This is the issue in the SDK https://github.com/zcash/zcash-android-wallet-sdk/issues/242
 - Implement the UI for displaying transaction history
 - Display fiat currency values
 - Hook up buttons to navigate to other screens (scan #137, profile #145, send #134, request #135)
2021-12-29 14:38:14 -05:00
Carter Jernigan 2e40af9390 [#17] Import wallet 2021-12-17 10:35:22 -05:00
Carter Jernigan 9db77e2afe
[#16] Skeleton for wallet creation
In addition to the UI, this implements improved state management for the WalletViewModel which emits a sealed class now.

Work remaining for followup PRs:
- Use drag-and-drop for chips instead of dropdown menus #85
- Add red background color for test fail screen #86 
- Add images for various screens (depends on #66 #64)
- Implement copy to clipboard #49
2021-11-17 15:19:49 -05:00
Carter Jernigan ec983f1f8f [#28] Initial SDK integration
This sets up the infrastructure needed to continue implementing the onboarding UI for create and import of wallets.  By fleshing out the global state management in the app now, we can better manage asynchronous IO to avoid blocking the UI.

This adds:

 - Load and persistence a wallet in encrypted preferences
     - The stored data is written as a single JSON object, as opposed to multiple entries, to ensure atomic writes
     - The data is versioned, so that we can change the JSON format readily in the future
 - Detection of application state, e.g. onboarding versus loading the user's wallet
 - Touch points to initialize the SDK
2021-11-12 07:09:43 -05:00