Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Add TryteString to bytes test cases #88

Conversation

mlouielu
Copy link
Contributor

@mlouielu mlouielu commented Oct 31, 2017

As for issue #62, this is the test cases for converting
TryteString to bytes, and bytes to TryteString.

(CI dead is correct)

As for issue iotaledger#62, this is the test cases for converting
TryteString to bytes, and bytes to TryteString.
@todofixthis
Copy link
Contributor

todofixthis commented Nov 1, 2017

Hey @mlouielu thank you for working on this! I've asked some of the core devs (who are better at maths than I am 😸) to have a look at this.

I had a few questions about these tests:

  • What should TryteString('NOP').as_bytes() return? (negative value)
  • I see that TryteString.from_bytes('', length=1) returns TryteString('9'). But, TryteString('').as_bytes(length=1) raises an IndexError; wouldn't it be more consistent if it returned b'\x00'?
  • I think the tests cover this, but help me to understand because I still don't get it 😇 :
    • Converting 27 trits to bytes: 27 % 5 != 0, so how is this conversion handled?

@todofixthis
Copy link
Contributor

Hey @mlouielu thanks again for your help with this feature! I'm working with a few individuals to try to nail down requirements for this codec — I feel like there are a number of edge cases that the existing implementations are not able to cover (https://github.com/vbakke/trytes/ has an excellent write-up of many of these issues).

In the meantime, I've put #62 on hold until we can work out all of the details.

@todofixthis todofixthis closed this Jan 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants