Skip to content
This repository has been archived by the owner on Nov 27, 2019. It is now read-only.

Migration to Swift 5.0 #38

Open
aronspringfield opened this issue Nov 10, 2019 · 1 comment
Open

Migration to Swift 5.0 #38

aronspringfield opened this issue Nov 10, 2019 · 1 comment

Comments

@aronspringfield
Copy link

aronspringfield commented Nov 10, 2019

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

  • 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
@ghost
Copy link

ghost commented Nov 10, 2019

Thanks for opening this issue! A maintainer will review this in the next few days and explicitly select labels so you know what's going on.

If no reviewer appears after a week, a reminder will be sent out.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant