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
Feature/BIP44 #719
Feature/BIP44 #719
Conversation
…, change and addressIndex from a valid bip44 path. code cleanup
…previous accounts have transactions
46adcea
to
48716c8
Compare
having some issues with swiftlint... I expect to fix them soon |
fixed swiftlint issues |
Sources/Web3Core/KeystoreManager/EtherscanTransactionChecker.swift
Outdated
Show resolved
Hide resolved
Just to mention: I'm actually waiting when @JeneaVranceanu issues would be applied to review it by myself. |
Sources/Web3Core/KeystoreManager/EtherscanTransactionChecker.swift
Outdated
Show resolved
Hide resolved
Sources/Web3Core/KeystoreManager/EtherscanTransactionChecker.swift
Outdated
Show resolved
Hide resolved
…URLSessionProxy from public to internal
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.
Great work, thank you for your effort!
@JeneaVranceanu please take a look at the last state of this one, it would be great to include it into 3.1.0 release. |
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.
Sorry for such a late one, haven't catch it in a prev review.
Sources/Web3Core/KeystoreManager/EtherscanTransactionChecker.swift
Outdated
Show resolved
Hide resolved
@yaroslavyaroslav On it right now. |
|
||
public protocol BIP44 { | ||
/** | ||
Derive an ``HDNode`` based on the provided path. The function will throw ``BIP44Error.warning`` if it was invoked with throwOnWarning equal to |
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.
Please, wrap throwOnWarning into backticks so that it stands out when reading this as compiled documentation.
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.
I'll highlight such issues as I go.
public protocol BIP44 { | ||
/** | ||
Derive an ``HDNode`` based on the provided path. The function will throw ``BIP44Error.warning`` if it was invoked with throwOnWarning equal to | ||
`true` and the root key doesn't have a previous child with at least one transaction. If it is invoked with throwOnError equal to `false` the child node will be |
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.
throwOnWarning wrap with backticks, please.
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.
On line 12 as well.
- Throws: any error related to query the blockchain provider | ||
- Returns: `true` if the address has at least one transaction, `false` otherwise | ||
*/ | ||
func hasTransactions(address: String) async throws -> Bool |
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.
Let's change the type of address to EthereumAddress
.
This way we reduce one potential error - an invalid ethereum address.
The fact that we implement TransactionChecker
and before we call hasTransactions
function we check that the address is valid we do not provide safety for others if they want to implement a version of TransactionChecker
themselves.
Any thoughts are welcome!
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.
Looks reasonable :)
struct Response: Codable { | ||
let result: [Transaction] | ||
} | ||
struct Transaction: Codable {} |
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.
Could you add at least a field like hash
to the Transaction
struct?
Or maybe a swift doc to that struct explaining why it's empty to make sure we won't spend time in the future thinking too much about why it's empty. 🙂
I guess it is something like We are not interested in the contents of the transaction object but rather the availability of the transaction per see for the sake of counting the number of transactions for a specific account.
.
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.
Apologies, I had no time yesterday.
@albertopeam There is only one comment that really concerns me: #719 (comment) The rest is actually looking very good. |
Sweet, now this was the last one within 3.1.0 I'll release it tomorrow or at monday. So please, folks, don't merge anything into dev right away. @JeneaVranceanu @janndriessen |
Summary of Changes
Adds bip44 to HDNode
Test Data or Screenshots
By submitting this pull request, you are confirming the following:
develop
branch.