-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: os-locator
Are you sure you want to change the base?
Add data access #64
Conversation
p8e-api/src/main/kotlin/io/provenance/engine/event/IndexHandler.kt
Outdated
Show resolved
Hide resolved
p8e-api/src/main/kotlin/io/provenance/engine/event/IndexHandler.kt
Outdated
Show resolved
Hide resolved
p8e-api/src/main/kotlin/io/provenance/engine/service/ChaincodeInvokeService.kt
Outdated
Show resolved
Hide resolved
p8e-api/src/main/kotlin/io/provenance/engine/service/ChaincodeInvokeService.kt
Outdated
Show resolved
Hide resolved
p8e-api/src/main/kotlin/io/provenance/engine/service/ChaincodeInvokeService.kt
Outdated
Show resolved
Hide resolved
p8e-api/src/main/kotlin/io/provenance/engine/service/ChaincodeInvokeService.kt
Outdated
Show resolved
Hide resolved
p8e-api/src/main/kotlin/io/provenance/engine/event/IndexHandler.kt
Outdated
Show resolved
Hide resolved
p8e-api/src/main/kotlin/io/provenance/engine/service/DataAccessChaincodeService.kt
Outdated
Show resolved
Hide resolved
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.
Looking good, nice job on working through figuring out who the heck is supposed to sign stuff 😆
p8e-api/src/main/kotlin/io/provenance/engine/event/IndexHandler.kt
Outdated
Show resolved
Hide resolved
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()) |
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 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).
p8e-api/src/main/kotlin/io/provenance/engine/event/IndexHandler.kt
Outdated
Show resolved
Hide resolved
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.
Good Job!!
if (envelopeDataAccess.any { it !in existingScopeDataAccess }) { | ||
p8e.Jobs.MsgAddScopeDataAccessRequest.newBuilder() | ||
.addAllDataAccess(envelopeDataAccess) | ||
.addAllSigners(envelope.data.result.signaturesList.map { |
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.
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.
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.
I left one comment about something to try out. Otherwise this looks great!
Description
This PR adds Data access to the contract scope after memorialization. Files to Check:
IndexHandler.kt
DataAccessChaincodeService.kt