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

Conversation

@jinnerbichler
Copy link
Contributor

@jinnerbichler jinnerbichler commented Dec 11, 2017

Fixes #38

Hey,

I've implemented the functionality to check whether a reattachment makes sense for certain addresses/transactions.

Best,
Hannes

@todofixthis
Copy link
Contributor

Thanks Hannes!! I will take a look later this week!

Copy link
Contributor

@todofixthis todofixthis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really great, thanks @jinnerbichler !

Two requests, both really minor, and then let's get this bad boy merged in!

from .replay_bundle import *
from .send_transfer import *
from .send_trytes import *
from .is_reattachable import *
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to keep these guys in alphabetical order. Makes it easier to tell at a glance if something is missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

{
'addresses': [f.FilterMapper.CODE_MISSING_KEY],
},
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we include a test for addresses not an array (e.g., calling is_reattachable(Address(...)))?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is that possible with filters (https://filters.readthedocs.io/en/latest/#)?

I couldn't find a proper configuration for accepting both, an Address OR an array containing Address objects?

That's how validation done at the time beeing:

class IsReattachableRequestFilter(RequestFilter):
  def __init__(self):
    super(IsReattachableRequestFilter, self).__init__(
      {
        'addresses': (
          f.Required
          | f.Array
          | f.FilterRepeater(
            f.Required
            | Trytes(result_type=Address)
            | f.Unicode(encoding='ascii', normalize=False)
          )
        )
      }
    )

Copy link
Contributor

@todofixthis todofixthis Jan 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry; that was irresponsible wording on my part — if addresses is not an array, the filter should reject it.

Just for the sake of coverage — if we were to remove f.Array from that filter, I don't think there are any unit tests that would fail as a result.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

np. Added this test case

@todofixthis
Copy link
Contributor

Hey @jinnerbichler I feel like this guy is really close to being ready to merge. Looks like you put a decent amount of work into it; would be awesome to integrate it into the library proper!

I've requested a few changes, but it's mostly minor stuff. Let me know if you have any questions, or if I can provide additional info.

@jinnerbichler
Copy link
Contributor Author

jinnerbichler commented Jan 8, 2018

@todofixthis Can you restart the CI? It had some problems fetching proper requirements for Python 3.6.

@todofixthis
Copy link
Contributor

todofixthis commented Jan 9, 2018

All set! 3.6 build finished successfully!

Sorry again for the ambiguous wording on my last comment. Once that last test is in place, we'll get this guy merged for the next release!

Copy link
Contributor

@todofixthis todofixthis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks @jinnerbichler !!

@todofixthis todofixthis merged commit 702760a into iotaledger-archive:develop Jan 14, 2018
marko-k0 pushed a commit to marko-k0/iota.lib.py that referenced this pull request Jul 28, 2018
…attachable

Implementation of IsReattachableCommand
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.

2 participants