generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decouple from UniFFI code-gen'd Web5Exception (#334)
- Loading branch information
1 parent
c63823e
commit ad6761f
Showing
36 changed files
with
510 additions
and
357 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package web5.sdk | ||
|
||
class Web5Exception( | ||
val variant: String, | ||
override val message: String | ||
) : Exception(message) { | ||
companion object { | ||
internal fun fromRustCore(e: web5.sdk.rust.Web5Exception.Exception): Web5Exception { | ||
return Web5Exception(e.variant, e.msg) | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,22 @@ | ||
package web5.sdk.crypto | ||
|
||
import web5.sdk.rust.Dsa as RustCoreDsa | ||
|
||
enum class Dsa { | ||
ED25519, | ||
SECP256K1; | ||
} | ||
|
||
internal fun dsaFromRustCore(rustCore: RustCoreDsa): Dsa { | ||
return when (rustCore) { | ||
RustCoreDsa.ED25519 -> Dsa.ED25519 | ||
RustCoreDsa.SECP256K1 -> Dsa.SECP256K1 | ||
} | ||
} | ||
|
||
internal fun dsaToRustCore(dsa: Dsa): RustCoreDsa { | ||
return when(dsa) { | ||
Dsa.ED25519 -> RustCoreDsa.ED25519 | ||
Dsa.SECP256K1 -> RustCoreDsa.SECP256K1 | ||
} | ||
} |
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
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
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
Oops, something went wrong.