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

Transfer a right #17

Merged
merged 5 commits into from
Feb 17, 2017
Merged

Transfer a right #17

merged 5 commits into from
Feb 17, 2017

Conversation

sohkai
Copy link
Contributor

@sohkai sohkai commented Oct 5, 2016

Fixes #5, fixes #6.

Builds on #25.

Needs to wait for COALAIP/pycoalaip-bigchaindb#18 before getting merged.

except ModelDataError:
right = models.Copyright.from_persist_id(right_id,
plugin=coalaip.plugin,
force_load=True)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This isn't super nice with the way I've set up Rights and Copyrights in pycoalaip, but it's either something like this where we do a best-effort guess or ask the user to supply the type of the Right.

The main issue is that, at the end of they day, we can never be 100% sure what an entity's type is if they haven't explicitly stated it themselves (@type breaks due to Manifestations able to be any submodel of CreativeWork).

README.md Outdated
},
"to": {
"verifyingKey": "<base58 string>",
"signingKey": "<base58 string>"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have to send a signingKey to transfer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pycoalaip's interface requires it; it expects a full user model regardless of whether or not that's necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can omit the signingKey since it's never used. I'd prefer to keep it in the dict, but set to null, so that the payload still matches pycoalaip-bigchaindb's user model.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See 6e2748c.

'action': 'loan',
},
'currentHolder': alice,
'to': bob,
Copy link
Contributor

Choose a reason for hiding this comment

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

We should just pass bob's verifyingKey

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See 6e2748c.

@sohkai sohkai force-pushed the feat/5/transfer-a-right branch 2 times, most recently from 6e2748c to 3c1f65f Compare February 10, 2017 11:12
@sohkai sohkai force-pushed the feat/5/transfer-a-right branch 3 times, most recently from 7fde8c2 to 5be8368 Compare February 10, 2017 12:53
PAYLOAD:
{
"rightId": "<ID of an existing Right to transfer; must be held by the user specified in `currentHolder`>",
"rightsAssignment": {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we'd add a document or sentence here that would state the conditions under which the Right is transferred, we'd also solve #6.

headers={'Content-Type': 'application/json'})

# Sleep for a bit to let the transaction become valid
sleep(3)
Copy link
Contributor

Choose a reason for hiding this comment

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

😴

plugin=coalaip.plugin,
force_load=True)
except ModelDataError:
right = entities.Copyright.from_persist_id(right_id,
Copy link
Contributor

Choose a reason for hiding this comment

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

cool, we can transfer a copyright as well!

@sohkai sohkai mentioned this pull request Feb 16, 2017
@sohkai
Copy link
Contributor Author

sohkai commented Feb 16, 2017

@TimDaub I've added 199c7d5 to resolve #6.

Copy link
Contributor

@TimDaub TimDaub left a comment

Choose a reason for hiding this comment

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

Awesome!

@sohkai sohkai force-pushed the feat/5/transfer-a-right branch 4 times, most recently from 2dcade2 to 0bf899a Compare February 17, 2017 20:49
@sohkai sohkai force-pushed the feat/5/transfer-a-right branch from 0bf899a to bbe8ec0 Compare February 17, 2017 21:13
@sohkai sohkai merged commit 39e954b into master Feb 17, 2017
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

Successfully merging this pull request may close these issues.

End-to-end "loan" functionality Transfer a Right
2 participants