Skip to content

Commit

Permalink
Merge pull request #337 from nova-wallet/develop
Browse files Browse the repository at this point in the history
v3.4.0
  • Loading branch information
ERussel committed Aug 1, 2022
2 parents 502e06c + b8fcafc commit fd0c798
Show file tree
Hide file tree
Showing 401 changed files with 10,131 additions and 4,978 deletions.
41 changes: 36 additions & 5 deletions .github/workflows/deploy_staging.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy to Staging
name: Manual deploy to Firebase

on:
workflow_dispatch:
Expand All @@ -10,6 +10,14 @@ on:
description: 'Firebase user group'
default: 'external-users'
required: true
config:
description: 'Configuration Dev/Staging'
default: Staging
required: true
type: choice
options:
- Staging
- Dev
# release:
# types: [published]

Expand Down Expand Up @@ -38,12 +46,19 @@ jobs:
- name: Install Cocoapods
run: pod install --repo-update

- name: Set env BUILD_PROVISION_PROFILE_BASE64
run: |
if [[ ${{ github.event.inputs.config }} == 'Staging' ]]; then
echo "BUILD_PROVISION_PROFILE_BASE64=${{ secrets.STAGING_PROVISIONING_PROFILE_BASE64 }}" >> "$GITHUB_ENV"
else
echo "BUILD_PROVISION_PROFILE_BASE64=${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}" >> "$GITHUB_ENV"
fi
# Source https://docs.github.com/en/actions/deployment/installing-an-apple-certificate-on-macos-runners-for-xcode-development#add-a-step-to-your-workflow
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ""
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.STAGING_PROVISIONING_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# create variables
Expand Down Expand Up @@ -85,11 +100,16 @@ jobs:
ACALA_TEST_AUTH_TOKEN: ${{ secrets.ACALA_TEST_AUTH_TOKEN }}
MOONBEAM_API_KEY: ${{ secrets.MOONBEAM_API_KEY }}
MOONBEAM_TEST_API_KEY: ${{ secrets.MOONBEAM_TEST_API_KEY }}
run: xcodebuild archive -archivePath ./AdHoc.xcarchive -scheme novawallet -workspace novawallet.xcworkspace -configuration Staging
run: xcodebuild archive -archivePath ./AdHoc.xcarchive -scheme novawallet -workspace novawallet.xcworkspace -configuration ${{ github.event.inputs.config }}

- name: Export archive
- name: Export Staging archive
if: ${{ github.event.inputs.config == 'Staging' }}
run: xcodebuild -exportArchive -archivePath ./AdHoc.xcarchive -exportPath ./export -exportOptionsPlist ./novawallet/exportOptionsStaging.plist

- name: Export Dev archive
if: ${{ github.event.inputs.config == 'Dev' }}
run: xcodebuild -exportArchive -archivePath ./AdHoc.xcarchive -exportPath ./export -exportOptionsPlist ./novawallet/exportOptionsAdHoc.plist

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
Expand All @@ -109,7 +129,18 @@ jobs:
name: novawallet.ipa
path: export

- name: Upload artifact to Firebase App Distribution
- name: Upload artifact to Firebase with Dev Id
if: ${{ github.event.inputs.config == 'Dev' }}
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{ secrets.FIREBASE_APP_ID }}
token: ${{ secrets.FIREBASE_TOKEN }}
groups: ${{ github.event.inputs.userGroup }}
file: export/novawallet.ipa
releaseNotes: ${{ github.event.head_commit.message }}

- name: Upload artifact to Firebase with Staging Id
if: ${{ github.event.inputs.config == 'Staging' }}
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{ secrets.FIREBASE_STAGING_APP_ID }}
Expand Down
882 changes: 588 additions & 294 deletions novawallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Dev"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
Expand Down
20 changes: 20 additions & 0 deletions novawallet/Assets.xcassets/colorWhite12.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.120",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "iconAddressPlaceholder64.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
12 changes: 12 additions & 0 deletions novawallet/Assets.xcassets/iconSettings.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "iconSettings.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
12 changes: 12 additions & 0 deletions novawallet/Assets.xcassets/iconWatchOnly.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "iconWatchOnly.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "iconWatchOnlyHeader.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
6 changes: 6 additions & 0 deletions novawallet/Assets.xcassets/iconsAction/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "iconChange.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "iconActionCopy.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "iconActionExport.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "iconWeb.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
12 changes: 12 additions & 0 deletions novawallet/Assets.xcassets/imageNoKeys.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "imageNoKeys.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
15 changes: 2 additions & 13 deletions novawallet/Assets.xcassets/logo.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
{
"images" : [
{
"filename" : "logo.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
"filename" : "logo.pdf",
"idiom" : "universal"
}
],
"info" : {
Expand Down
Binary file added novawallet/Assets.xcassets/logo.imageset/logo.pdf
Binary file not shown.
Binary file removed novawallet/Assets.xcassets/logo.imageset/logo.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions novawallet/Common/Configs/ApplicationConfigs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ extension ApplicationConfig: ApplicationConfigProtocol {

var chainListURL: URL {
#if F_RELEASE
URL(string: "https://raw.githubusercontent.com/nova-wallet/nova-utils/master/chains/v4/chains.json")!
URL(string: "https://raw.githubusercontent.com/nova-wallet/nova-utils/master/chains/v5/chains.json")!
#else
URL(string: "https://raw.githubusercontent.com/nova-wallet/nova-utils/master/chains/v4/chains_dev.json")!
URL(string: "https://raw.githubusercontent.com/nova-wallet/nova-utils/master/chains/v5/chains_dev.json")!
#endif
}

Expand Down
4 changes: 2 additions & 2 deletions novawallet/Common/Crypto/EthereumSigner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import IrohaCrypto
import SoraKeystore
import SubstrateSdk

final class EthereumSigner {
final class EthereumSigner: SignatureCreatorProtocol {
let keystore: KeystoreProtocol
let metaId: String
let accountId: AccountId?
Expand All @@ -16,7 +16,7 @@ final class EthereumSigner {
publicKeyData = ethereumAccountResponse.publicKey
}

func sign(hashedData: Data) throws -> IRSignatureProtocol {
func sign(_ hashedData: Data) throws -> IRSignatureProtocol {
let tag = KeystoreTagV2.ethereumSecretKeyTagForMetaId(metaId, accountId: accountId)

let secretKey = try keystore.fetchKey(for: tag)
Expand Down
25 changes: 25 additions & 0 deletions novawallet/Common/Crypto/NoKeysSigningWrapper.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import Foundation
import IrohaCrypto

enum NoKeysSigningWrapperError: Error {
case watchOnly
}

final class NoKeysSigningWrapper: SigningWrapperProtocol {
func sign(_: Data) throws -> IRSignatureProtocol {
throw NoKeysSigningWrapperError.watchOnly
}
}

extension Error {
var isWatchOnlySigning: Bool {
guard let noKeysError = self as? NoKeysSigningWrapperError else {
return false
}

switch noKeysError {
case .watchOnly:
return true
}
}
}
27 changes: 24 additions & 3 deletions novawallet/Common/Crypto/SigningWrapperFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,46 @@ protocol SigningWrapperFactoryProtocol {
func createSigningWrapper(
for ethereumAccountResponse: MetaEthereumAccountResponse
) -> SigningWrapperProtocol

func createEthereumSigner(for ethereumAccountResponse: MetaEthereumAccountResponse) -> SignatureCreatorProtocol
}

final class SigningWrapperFactory: SigningWrapperFactoryProtocol {
let keystore: KeystoreProtocol

init(keystore: KeystoreProtocol) {
init(keystore: KeystoreProtocol = Keychain()) {
self.keystore = keystore
}

func createSigningWrapper(
for metaId: String,
accountResponse: ChainAccountResponse
) -> SigningWrapperProtocol {
SigningWrapper(keystore: keystore, metaId: metaId, accountResponse: accountResponse)
switch accountResponse.type {
case .secrets:
return SigningWrapper(keystore: keystore, metaId: metaId, accountResponse: accountResponse)
case .watchOnly:
return NoKeysSigningWrapper()
}
}

func createSigningWrapper(
for ethereumAccountResponse: MetaEthereumAccountResponse
) -> SigningWrapperProtocol {
SigningWrapper(keystore: keystore, ethereumAccountResponse: ethereumAccountResponse)
switch ethereumAccountResponse.type {
case .secrets:
return SigningWrapper(keystore: keystore, ethereumAccountResponse: ethereumAccountResponse)
case .watchOnly:
return NoKeysSigningWrapper()
}
}

func createEthereumSigner(for ethereumAccountResponse: MetaEthereumAccountResponse) -> SignatureCreatorProtocol {
switch ethereumAccountResponse.type {
case .secrets:
return EthereumSigner(keystore: keystore, ethereumAccountResponse: ethereumAccountResponse)
case .watchOnly:
return NoKeysSigningWrapper()
}
}
}
4 changes: 3 additions & 1 deletion novawallet/Common/Crypto/SigningWrapperProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import Foundation
import IrohaCrypto
import SubstrateSdk

protocol SigningWrapperProtocol: IRSignatureCreatorProtocol {}
protocol SignatureCreatorProtocol: IRSignatureCreatorProtocol {}

protocol SigningWrapperProtocol: SignatureCreatorProtocol {}

extension SigningWrapperProtocol {
func signSr25519(_ originalData: Data, secretKeyData: Data, publicKeyData: Data) throws
Expand Down
Loading

0 comments on commit fd0c798

Please sign in to comment.