Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EntityWithHashchain.Event.__mutate__ is never called #164

Closed
chanhosuh opened this issue Nov 14, 2018 · 4 comments
Closed

EntityWithHashchain.Event.__mutate__ is never called #164

chanhosuh opened this issue Nov 14, 2018 · 4 comments

Comments

@chanhosuh
Copy link
Contributor

chanhosuh commented Nov 14, 2018

I noticed that in the code for EntityWithHashChain.Created, the super call does not put in the class of self, but of its parent:

        def __mutate__(self, entity_class=None):
            # Call super method.
            obj = super(EntityWithHashchain.Event, self).__mutate__(entity_class)

            # Set entity head from event hash.
            obj.__head__ = self.__event_hash__

            return obj

This means the __mutate__ of EntityWithHashChain.Event is skipped. In fact, fixing the super call will make the example code in the quickstart guide fail. Probably the fix should be to remove the method.

@johnbywater
Copy link
Collaborator

Wow, well spotted! :)) you're good!

johnbywater added a commit that referenced this issue Nov 15, 2018
Was producing the right answer, but accidentally.

Thanks to Chan-Ho Suh for spotting the issue:
#164
@johnbywater
Copy link
Collaborator

@chanhosuh I fixed it like this: 94ffec3

@johnbywater
Copy link
Collaborator

Tests passed so I'll close this. Please reopen if you need to. Many thanks for spotting this issue, and if you spot anything else, please don't hesitate to open another! :)

@chanhosuh
Copy link
Contributor Author

@johnbywater that's great! I was feeling guilty about posting a sloppy issue and was planning to write a formal PR so I could run your tests etc... but you've pre-empted me :)

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

No branches or pull requests

2 participants