ethers-io / ethers.objc

Fast, simple and complete library for Ethereum in Objective-C.
MIT License
157 stars 57 forks source link

Fix -[Account isEqual:] #8

Closed zweigraf closed 7 years ago

zweigraf commented 7 years ago

-isEqual contained a logic error, making comparisons to other Accounts always fail.

I checked other classes as well, but it seems this was the only instance of this typo.

ricmoo commented 7 years ago

Egad!! You are right! I will add test cases and verify this tonight.

Good catch! (I'm guessing you had an issue where it was incorrectly passing... :s)

Thanks!

ricmoo commented 7 years ago

Fixed!

https://github.com/ethers-io/ethers.objc/commit/b32d411733f998635a19bb4583afe9e614ae1e7d

Thanks again, and let me know of any other bugs you find. :)

zweigraf commented 7 years ago

Thanks for reacting so quickly :)

But for completion, it was actually the other way round. This was failing and printing false:

    let legalAccount = Account(mnemonicPhrase: "legal winner thank year wave sausage worth useful legal winner thank yellow")
    print("account equal?", Account(mnemonicPhrase: legalAccount!.mnemonicPhrase) == legalAccount)