Skip to content

Commit

Permalink
workaround for concordium_base build dep
Browse files Browse the repository at this point in the history
  • Loading branch information
soerenbf committed Sep 13, 2024
1 parent 0d80f8b commit c5c6b9d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint+test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Run linter
run: cargo clippy --all-targets --all-features -- -Dwarnings
- name: Run tests
run: cargo test
run: make test
- name: Build Swift package (macOS/x86_64 only)
if: runner.os == 'macOS' && runner.arch == 'X64'
run: |
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ framework: clean-generated swift-bindings lib-darwin lib-ios lib-ios-sim

.PHONY: swift-bindings
swift-bindings: # produces './generated/bindings'
$(cargo) run --bin=uniffi-bindgen generate src/lib.udl --language=swift --out-dir=./generated/bindings
$(cargo) run --target=x86_64-apple-darwin --bin=uniffi-bindgen generate src/lib.udl --language=swift --out-dir=./generated/bindings
mkdir -p ./Sources/ConcordiumWalletCrypto
# Move Swift bridge code to source folder.
# The remaining files (header and renamed modulemap) should go into the framework
Expand Down Expand Up @@ -112,4 +112,4 @@ lint-fix:

.PHONY: test
test:
$(cargo) test
$(cargo) test --target=x86_64-apple-darwin # needed due to name collission when concordium_base is included in build dependencies
15 changes: 15 additions & 0 deletions Sources/ConcordiumWalletCrypto/generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3921,6 +3921,18 @@ public func accountCredentialSigningKey(seed: Bytes, network: String, identityPr
}
)
}
/**
* Attempt to combine two encrypted amounts
*/
public func combineEncryptedAmounts(left: Bytes, right: Bytes) throws -> Bytes {
return try FfiConverterTypeBytes.lift(
try rustCallWithError(FfiConverterTypeConcordiumWalletCryptoError.lift) {
uniffi_concordium_wallet_crypto_uniffi_fn_func_combine_encrypted_amounts(
FfiConverterTypeBytes.lower(left),
FfiConverterTypeBytes.lower(right),$0)
}
)
}
/**
* Attempt to create the encryption keys associated with an account at the given credential index
*/
Expand Down Expand Up @@ -4277,6 +4289,9 @@ private var initializationResult: InitializationResult {
if (uniffi_concordium_wallet_crypto_uniffi_checksum_func_account_credential_signing_key() != 116) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_concordium_wallet_crypto_uniffi_checksum_func_combine_encrypted_amounts() != 56311) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_concordium_wallet_crypto_uniffi_checksum_func_decrypt_amount() != 53254) {
return InitializationResult.apiChecksumMismatch
}
Expand Down

0 comments on commit c5c6b9d

Please sign in to comment.