-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #352 from nova-wallet/develop
v3.5.0
- Loading branch information
Showing
241 changed files
with
5,592 additions
and
1,541 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
Large diffs are not rendered by default.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
novawallet/Assets.xcassets/iconHardwareWallet.imageset/Contents.json
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 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "iconHardwareWallet.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+5.81 KB
novawallet/Assets.xcassets/iconHardwareWallet.imageset/iconHardwareWallet.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
novawallet/Assets.xcassets/iconParitySigner.imageset/Contents.json
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 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "iconParitySigner.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+1.62 KB
novawallet/Assets.xcassets/iconParitySigner.imageset/iconParitySigner.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
novawallet/Assets.xcassets/iconParitySignerHeader.imageset/Contents.json
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 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "iconParitySignerHeader.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+1.66 KB
novawallet/Assets.xcassets/iconParitySignerHeader.imageset/iconParitySignerHeader.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
novawallet/Assets.xcassets/iconParitySignerInSheet.imageset/Contents.json
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 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "iconParitySigner.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+9.42 KB
novawallet/Assets.xcassets/iconParitySignerInSheet.imageset/iconParitySigner.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
novawallet/Assets.xcassets/imageNovaParitySigner.imageset/Contents.json
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 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "imageNovaParitySigner.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+551 KB
novawallet/Assets.xcassets/imageNovaParitySigner.imageset/imageNovaParitySigner.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
novawallet/Assets.xcassets/imageParitySignerIntegrationHint.imageset/Contents.json
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 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "imageParitySignerIntegrationHint.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+183 KB
...s.xcassets/imageParitySignerIntegrationHint.imageset/imageParitySignerIntegrationHint.pdf
Binary file not shown.
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,5 @@ | ||
import Foundation | ||
|
||
enum HardwareSigningError: Error { | ||
case signingCancelled | ||
} |
22 changes: 22 additions & 0 deletions
22
novawallet/Common/Crypto/MetaAccountModelType+SignatureFormat.swift
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,22 @@ | ||
import Foundation | ||
import SubstrateSdk | ||
|
||
extension MetaAccountModelType { | ||
var signaturePayloadFormat: ExtrinsicSignaturePayloadFormat { | ||
switch self { | ||
case .secrets, .watchOnly: | ||
return .regular | ||
case .paritySigner: | ||
return .paritySigner | ||
} | ||
} | ||
|
||
var supportsSigningRawBytes: Bool { | ||
switch self { | ||
case .secrets, .watchOnly: | ||
return true | ||
case .paritySigner: | ||
return false | ||
} | ||
} | ||
} |
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 @@ | ||
import Foundation | ||
import IrohaCrypto | ||
|
||
enum NoSigningSupportError: Error { | ||
case notSupported | ||
} | ||
|
||
final class NoSigningSupportWrapper: SigningWrapperProtocol { | ||
func sign(_: Data) throws -> IRSignatureProtocol { | ||
throw NoSigningSupportError.notSupported | ||
} | ||
} |
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,57 @@ | ||
import Foundation | ||
import IrohaCrypto | ||
|
||
/** | ||
* Implementation of the signing for Parity Signer makes | ||
* an assumption that signing is called in one of the background threads. | ||
* And one can suspend it (thus blocking the whole operation sending flow) and | ||
* launch signing ui in main thread. The callback with | ||
* the result should unblock signing thread to continue sending operation. | ||
*/ | ||
final class ParitySignerSigningWrapper { | ||
let uiPresenter: TransactionSigningPresenting | ||
let metaId: String | ||
let chainId: ChainModel.Id | ||
|
||
init( | ||
uiPresenter: TransactionSigningPresenting, | ||
metaId: String, | ||
chainId: ChainModel.Id | ||
) { | ||
self.uiPresenter = uiPresenter | ||
self.metaId = metaId | ||
self.chainId = chainId | ||
} | ||
} | ||
|
||
extension ParitySignerSigningWrapper: SigningWrapperProtocol { | ||
func sign(_ originalData: Data) throws -> IRSignatureProtocol { | ||
let semaphore = DispatchSemaphore(value: 0) | ||
|
||
var signingResult: TransactionSigningResult? | ||
|
||
DispatchQueue.main.async { | ||
self.uiPresenter.presentParitySignerFlow( | ||
for: originalData, | ||
metaId: self.metaId, | ||
chainId: self.chainId | ||
) { result in | ||
signingResult = result | ||
|
||
semaphore.signal() | ||
} | ||
} | ||
|
||
// block tx sending flow until we get signing result from ui | ||
semaphore.wait() | ||
|
||
switch signingResult { | ||
case let .success(signature): | ||
return signature | ||
case let .failure(error): | ||
throw error | ||
case .none: | ||
throw CommonError.undefined | ||
} | ||
} | ||
} |
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.