-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ABW-1316] Split out signing and submission from TransactionClient
, introduce Signing
feature (prepares for signing w Ledger)
#455
Conversation
case let .failedToGetTransactionStatus(txID, _): | ||
return (errorKind: .failedToPollSubmittedTransaction, message: "TXID: \(txID)") | ||
} | ||
// case let .failedToSubmit(error): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be fixed... by someone :P
return error.localizedDescription | ||
case .failedToSubmit: | ||
return "Failed to submit tx" | ||
// case let .failedToSubmit(error): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be fixed... by someone :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only managed to review 1/5 of the PR, will continue tomorrow morning.
Sources/Clients/SubmitTransactionClient/SubmitTransactionClient+Interface.swift
Outdated
Show resolved
Hide resolved
if pollCount >= pollStrategy.maxPollTries { | ||
statusSubject.send(.init( | ||
txID: txID, | ||
result: .failure(.failedToGetTransactionStatus( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this breaks the while
loop, since failure
=> isComplete: true
.
else { | ||
throw FailedToDeviceFactorSourceForSigning() | ||
} | ||
let hdRoot = try loadedMnemonicWithPassphrase.hdRoot() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a huge improvement, this does not require any "cache" of mnemonics we had earlier, since we sign with all accounts for this hdRoot
"in one go".
@@ -0,0 +1,32 @@ | |||
import FeaturePrelude | |||
|
|||
extension SignWithLedgerFactorSource.State { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty / Not impl for now, to be impl in coming PR
import FeaturePrelude | ||
|
||
// MARK: - SignWithLedgerFactorSource | ||
public struct SignWithLedgerFactorSource: SignWithFactorReducerProtocol { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty / Not impl for now, to be impl in coming PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, awesome job!!!
JIRA ABW-1316
This PR does NOT implement signing with Ledger as git branch name might suggest. That will follow in subsequent PR. This PR does however prepare for signing with factor sources which requires UI flow.
This PR splits out:
from TransactionClient
Signing is moved into VIEW layer, a Feature called
Signing
.Furthermore, this PR introduces a picker for Fee Payer. It drastically reduces complexity of TransactionClient, by use of an ephemeral
notary
key pair.I've simplified TransactionClient a lot by removing the
Result
stuff. TransactionClient goes from 800 loc to 400 loc. 🎉The best this PR can do is to not break anything and work just as well with the currently only supported factor source:
.device
.Demo
Select fee payer
Look at slack
Two signers
This demonstrates signing with TWO accounts.
https://user-images.githubusercontent.com/116169792/235083340-43d88f0d-40e0-4d18-9f9b-60744fe3309f.MOV
CALL TO ACTION
@kugel3 We REALLY REALLY should after this PR get merged change
TransactionReview
Reducer, by introducing a new coordinating Reducer called... perhapsTransact
which coordinates: