You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 27, 2019. It is now read-only.
To keep up to date, the project should be migrated to Swift 5.0.
Current Behavior
The project is currently being compiled against Swift 4.0, which is some way behind.
Possible Solution
I've ran the migration from XCode 11.2, there's only one required change which is pretty straight forward.
There is an issue that needs addressing, which may well be the reason this hasn't happened yet. After updating the BitcoinKit dependancy to their latest release (1.1.0) that introduces Swift 5.0 support, not all of the test cases succeed.
The issue comes from a rewrite of the file 'BitcoinPrivate' from Objective-C to Swift, which changes the behaviour of the private key validation. Previously, a 33 byte private key hex would successfully generate a public key. The Swift version validates the byte length is 32 bytes, which for this test case it does not work.
This means the latest 1.1.0 release cannot be used. Either this project continues to use an old version, or a fork of the dependancy is made to fix the issue.
Steps to Reproduce (for bugs)
An isolated test to recreate the issue using BitcoinKit 1.1.0.
func testBitcoinKit() { let hex = "034151a3ec46b5670a682b0a63394f863587d1bc97483b1b6c70eb58e7f0aed192" let privateKey = PrivateKey(data: Data(hex: hex)!) let publicKey = privateKey.publicKey() }
Your Environment
Version used: [https://github.com/ArkEcosystem/swift-crypto/commit/65fd178839d12f826efc59cd79a27f082de46818](Latest Source)
Environment name and version: XCode 11.2, Swift 5.0
Operating System and version: MacOS Catalina 10.15.1
The text was updated successfully, but these errors were encountered:
Expected Behavior
To keep up to date, the project should be migrated to Swift 5.0.
Current Behavior
The project is currently being compiled against Swift 4.0, which is some way behind.
Possible Solution
I've ran the migration from XCode 11.2, there's only one required change which is pretty straight forward.
There is an issue that needs addressing, which may well be the reason this hasn't happened yet. After updating the BitcoinKit dependancy to their latest release (1.1.0) that introduces Swift 5.0 support, not all of the test cases succeed.
The issue comes from a rewrite of the file 'BitcoinPrivate' from Objective-C to Swift, which changes the behaviour of the private key validation. Previously, a 33 byte private key hex would successfully generate a public key. The Swift version validates the byte length is 32 bytes, which for this test case it does not work.
This means the latest 1.1.0 release cannot be used. Either this project continues to use an old version, or a fork of the dependancy is made to fix the issue.
Steps to Reproduce (for bugs)
An isolated test to recreate the issue using BitcoinKit 1.1.0.
func testBitcoinKit() { let hex = "034151a3ec46b5670a682b0a63394f863587d1bc97483b1b6c70eb58e7f0aed192" let privateKey = PrivateKey(data: Data(hex: hex)!) let publicKey = privateKey.publicKey() }
Your Environment
The text was updated successfully, but these errors were encountered: