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

Add data access #64

Open
wants to merge 17 commits into
base: os-locator
Choose a base branch
from
Open

Add data access #64

wants to merge 17 commits into from

Conversation

wbaker-figure
Copy link

Description

This PR adds Data access to the contract scope after memorialization. Files to Check:
IndexHandler.kt
DataAccessChaincodeService.kt

@wbaker-figure wbaker-figure requested a review from a team as a code owner June 29, 2021 20:26
Copy link
Collaborator

@piercetrey-figure piercetrey-figure left a comment

Choose a reason for hiding this comment

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

Looking good, nice job on working through figuring out who the heck is supposed to sign stuff 😆

val affiliate =
transaction { affiliateService.get(publicKey) }.orThrowNotFound("Affiliate with public key ${publicKey.toHex()} not found")
val affiliateKeyPair =
KeyPair(affiliate.publicKey.value.toJavaPublicKey(), affiliate.privateKey.toJavaPrivateKey())
Copy link
Contributor

Choose a reason for hiding this comment

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

We may need to add SmartKey support here as well ... probably setup data under KeyRef data class (hopefully this branch goes out before mine so you don't have to worry about it) :)

Essentially instead of a KeyPair, we have KeyRef that contains key information such as public key, maybe private key?, UUID (SmartKey way of identifying a private key stored on their system).

Copy link
Contributor

@rchaing-figure rchaing-figure left a comment

Choose a reason for hiding this comment

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

Good Job!!

if (envelopeDataAccess.any { it !in existingScopeDataAccess }) {
p8e.Jobs.MsgAddScopeDataAccessRequest.newBuilder()
.addAllDataAccess(envelopeDataAccess)
.addAllSigners(envelope.data.result.signaturesList.map {

Choose a reason for hiding this comment

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

By any chance did you test this with a multiparty contract? I'm not positive, but I think the only signer we want is the scope owner. In the case for our scopes that's always a single invoker. If you only ran single party contracts, the envelope.data.result.signaturesList should only contain the invoker so it's not a big deal. It would take a multiparty contract to see if this fails or not as is.

Copy link

@scirner22 scirner22 left a comment

Choose a reason for hiding this comment

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

I left one comment about something to try out. Otherwise this looks great!

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.

4 participants