-
Notifications
You must be signed in to change notification settings - Fork 10
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
Transfer a right #17
Conversation
web/views/rights.py
Outdated
except ModelDataError: | ||
right = models.Copyright.from_persist_id(right_id, | ||
plugin=coalaip.plugin, | ||
force_load=True) |
There was a problem hiding this comment.
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>" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See 6e2748c.
tests/test_api.py
Outdated
'action': 'loan', | ||
}, | ||
'currentHolder': alice, | ||
'to': bob, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See 6e2748c.
6e2748c
to
3c1f65f
Compare
7fde8c2
to
5be8368
Compare
PAYLOAD: | ||
{ | ||
"rightId": "<ID of an existing Right to transfer; must be held by the user specified in `currentHolder`>", | ||
"rightsAssignment": { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
2dcade2
to
0bf899a
Compare
0bf899a
to
bbe8ec0
Compare
Fixes #5, fixes #6.
Builds on #25.
Needs to wait for COALAIP/pycoalaip-bigchaindb#18 before getting merged.