Skip to content

Commit

Permalink
fix(wallet-mobile): Update iOS deployment target to v 14.0 (#3765)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljscript authored Dec 16, 2024
1 parent 1f70ac1 commit c19f189
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 15 deletions.
10 changes: 6 additions & 4 deletions apps/wallet-mobile/ios/yoroi.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@
"$(inherited)",
);
INFOPLIST_FILE = yoroiTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -802,7 +802,7 @@
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = F8NVT2G2L4;
ENVFILE = "$(PODS_ROOT)/../../.env";
INFOPLIST_FILE = yoroiTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -970,7 +970,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
Expand Down Expand Up @@ -1044,7 +1044,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
Expand Down Expand Up @@ -1088,6 +1088,7 @@
ENVFILE = "$(PODS_ROOT)/../../.env.nightly";
INFOPLIST_FILE = nightly.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Yoroi Nightly";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1132,6 +1133,7 @@
ENVFILE = "$(PODS_ROOT)/../../.env.nightly";
INFOPLIST_FILE = nightly.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Yoroi Nightly";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
42 changes: 31 additions & 11 deletions apps/wallet-mobile/src/features/Discover/common/ledger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,27 +98,47 @@ async function formatLedgerWithdrawals(
): Promise<Array<Withdrawal>> {
const result: Array<Withdrawal> = []

const withdrawalKeys = await withdrawals.keys()
for (let i = 0; i < (await withdrawalKeys.len()); i++) {
const rewardAddress = await withdrawalKeys.get(i)
const keys = await withdrawals.keys()
const keysLength = await keys.len()
for (let i = 0; i < keysLength; i++) {
const rewardAddress = await keys.get(i)
const withdrawalAmount = await withdrawals.get(rewardAddress)
if (withdrawalAmount == null) {
throw new Error(`formatLedgerWithdrawals should never happen`)
}

const rewardAddressPayload = Buffer.from(await rewardAddress.toAddress().then((a) => a.toBytes())).toString('hex')
const rewardAddressPayload = await (await rewardAddress.toAddress()).toHex()
const addressing = addressingMap(rewardAddressPayload)
if (addressing == null) {
throw new Error(`formatLedgerWithdrawals Ledger can only withdraw from own address ${rewardAddressPayload}`)
let stakeCredential: null | Withdrawal['stakeCredential'] = null
if (addressing != null) {
stakeCredential = {
type: CredentialParamsType.KEY_PATH,
keyPath: addressing.path,
}
} else {
const cred = await rewardAddress.paymentCred()
const maybeKeyHash = await cred.toKeyhash()
const maybeScriptHash = await cred.toScripthash()
if (maybeKeyHash) {
stakeCredential = {
type: CredentialParamsType.KEY_HASH,
keyHashHex: await maybeKeyHash.toHex(),
}
} else if (maybeScriptHash) {
stakeCredential = {
type: CredentialParamsType.SCRIPT_HASH,
scriptHashHex: await maybeScriptHash.toHex(),
}
}
}
if (stakeCredential === null) {
throw new Error('Failed to resolve credential type for reward address: ' + rewardAddressPayload)
}
result.push({
amount: await withdrawalAmount.toStr(),
stakeCredential: {
type: CredentialParamsType.KEY_PATH,
keyPath: addressing.path,
},
stakeCredential,
})
}

return result
}
async function formatLedgerCertificates(
Expand Down

0 comments on commit c19f189

Please sign in to comment.