-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to
zcash_client_sqlite 0.12
(#1613)
* rust: Raise MSRV to 1.82 * rust: Fix clippy lints after MSRV bump * rust: Migrate to `#[unsafe(no_mangle)]` * rust: Remove superfluous generated file The PoC was added to the codebase in 01efabe. It was removed in 5f90675 but the generated bindings were missed. * Migrate to `zcash_client_sqlite 0.12` * Remove incorrect javadoc * Use `zcash_client_sqlite 0.12.2` to avoid a bug * Remove `quickRewind ` - Changelog updated - Demo app use of the quick rewind action replaced --------- Co-authored-by: Honza <[email protected]>
- Loading branch information
Showing
18 changed files
with
294 additions
and
1,043 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
backend-lib/src/main/java/cash/z/ecc/android/sdk/internal/model/JniRewindResult.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package cash.z.ecc.android.sdk.internal.model | ||
|
||
import androidx.annotation.Keep | ||
import cash.z.ecc.android.sdk.internal.ext.isInUIntRange | ||
|
||
/** | ||
* Serves as cross layer (Kotlin, Rust) communication class. | ||
*/ | ||
@Keep | ||
sealed class JniRewindResult { | ||
/** | ||
* A rewind was successful. | ||
* | ||
* `height` is the height to which the data store was actually truncated. | ||
*/ | ||
@Keep | ||
class Success(val height: Long) : JniRewindResult() { | ||
init { | ||
require(height.isInUIntRange()) { | ||
"Height $height is outside of allowed UInt range" | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* A requested rewind would violate invariants of the storage layer. | ||
* | ||
* If no safe rewind height can be determined, the safe rewind height member will be -1. | ||
*/ | ||
@Keep | ||
class Invalid(val safeRewindHeight: Long, val requestedHeight: Long) : JniRewindResult() { | ||
init { | ||
if (safeRewindHeight != -1L) { | ||
require(safeRewindHeight.isInUIntRange()) { | ||
"Height $safeRewindHeight is outside of allowed UInt range and is not -1" | ||
} | ||
} | ||
require(requestedHeight.isInUIntRange()) { | ||
"Height $requestedHeight is outside of allowed UInt range" | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.