Skip to content

Add data access#64

Open
wbaker-figure wants to merge 17 commits into
os-locatorfrom
add_data_access
Open

Add data access#64
wbaker-figure wants to merge 17 commits into
os-locatorfrom
add_data_access

Conversation

@wbaker-figure

Copy link
Copy Markdown

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
Comment thread p8e-api/src/main/kotlin/io/provenance/engine/event/IndexHandler.kt Outdated
Comment thread p8e-api/src/main/kotlin/io/provenance/engine/event/IndexHandler.kt Outdated
Comment thread p8e-api/src/main/kotlin/io/provenance/engine/service/ChaincodeInvokeService.kt Outdated
Comment thread p8e-api/src/main/kotlin/io/provenance/engine/service/ChaincodeInvokeService.kt Outdated
Comment thread p8e-api/src/main/kotlin/io/provenance/engine/service/ChaincodeInvokeService.kt Outdated
Comment thread p8e-api/src/main/kotlin/io/provenance/engine/event/IndexHandler.kt Outdated

@piercetrey-figure piercetrey-figure left a comment

Copy link
Copy Markdown
Collaborator

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 😆

Comment thread p8e-api/src/main/kotlin/io/provenance/engine/event/IndexHandler.kt Outdated
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
Copy Markdown
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).

Comment thread p8e-api/src/main/kotlin/io/provenance/engine/event/IndexHandler.kt Outdated

@rchaing-figure rchaing-figure left a comment

Copy link
Copy Markdown
Contributor

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 {

Copy link
Copy Markdown

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.

@scirner22 scirner22 left a comment

Copy link
Copy Markdown

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.

5 participants