Skip to content

Commit

Permalink
remove the commented code
Browse files Browse the repository at this point in the history
Signed-off-by: mineme0110 <[email protected]>
  • Loading branch information
mineme0110 committed Oct 31, 2024
1 parent 0123ed8 commit e0ad6ae
Showing 1 changed file with 0 additions and 107 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,113 +112,6 @@ object MockDIDService extends Mock[DIDService] {
): (PrismDIDOperation.Create, Secp256k1KeyPair, DIDMetadata, DIDData) = {
createDIDInternal(verificationRelationship, addEd25519Key = true)
}
// def createDIDOIDC(
// verificationRelationship: VerificationRelationship
// ): (PrismDIDOperation.Create, Secp256k1KeyPair, DIDMetadata, DIDData) = {
// val masterKeyPair = Apollo.default.secp256k1.generateKeyPair
// val keyPair = Apollo.default.secp256k1.generateKeyPair
//
// val createOperation = PrismDIDOperation.Create(
// publicKeys = Seq(
// InternalPublicKey(
// id = KeyId("master-0"),
// purpose = InternalKeyPurpose.Master,
// publicKeyData = PublicKeyData.ECCompressedKeyData(
// crv = EllipticCurve.SECP256K1,
// data = Base64UrlString.fromByteArray(masterKeyPair.publicKey.getEncodedCompressed)
// )
// ),
// PublicKey(
// id = KeyId("key-0"),
// purpose = verificationRelationship,
// publicKeyData = PublicKeyData.ECCompressedKeyData(
// crv = EllipticCurve.SECP256K1,
// data = Base64UrlString.fromByteArray(keyPair.publicKey.getEncodedCompressed)
// )
// ),
// ),
// services = Nil,
// context = Nil,
// )
// val longFormDid = PrismDID.buildLongFormFromOperation(createOperation)
// // val canonicalDid = longFormDid.asCanonical
//
// val didMetadata =
// DIDMetadata(
// lastOperationHash = ArraySeq.from(longFormDid.stateHash.toByteArray),
// canonicalId = None, // unpublished DID must not contain canonicalId
// deactivated = false, // unpublished DID cannot be deactivated
// created = None, // unpublished DID cannot have timestamp
// updated = None // unpublished DID cannot have timestamp
// )
// val didData = DIDData(
// id = longFormDid.asCanonical,
// publicKeys = createOperation.publicKeys.collect { case pk: PublicKey => pk },
// services = createOperation.services,
// internalKeys = createOperation.publicKeys.collect { case pk: InternalPublicKey => pk },
// context = createOperation.context
// )
// (createOperation, keyPair, didMetadata, didData)
// }
//
// def createDID(
// verificationRelationship: VerificationRelationship
// ): (PrismDIDOperation.Create, Secp256k1KeyPair, DIDMetadata, DIDData) = {
// val masterKeyPair = Apollo.default.secp256k1.generateKeyPair
// val keyPair = Apollo.default.secp256k1.generateKeyPair
// val keyPair2 = Apollo.default.ed25519.generateKeyPair
//
// val createOperation = PrismDIDOperation.Create(
// publicKeys = Seq(
// InternalPublicKey(
// id = KeyId("master-0"),
// purpose = InternalKeyPurpose.Master,
// publicKeyData = PublicKeyData.ECCompressedKeyData(
// crv = EllipticCurve.SECP256K1,
// data = Base64UrlString.fromByteArray(masterKeyPair.publicKey.getEncodedCompressed)
// )
// ),
// PublicKey(
// id = KeyId("key-0"),
// purpose = verificationRelationship,
// publicKeyData = PublicKeyData.ECCompressedKeyData(
// crv = EllipticCurve.SECP256K1,
// data = Base64UrlString.fromByteArray(keyPair.publicKey.getEncodedCompressed)
// )
// ),
// PublicKey(
// id = KeyId("key-1"),
// purpose = verificationRelationship,
// publicKeyData = PublicKeyData.ECKeyData(
// crv = EllipticCurve.ED25519,
// x = Base64UrlString.fromByteArray(keyPair2.publicKey.getEncoded),
// y = Base64UrlString.fromByteArray(Array.emptyByteArray),
// )
// ),
// ),
// services = Nil,
// context = Nil,
// )
// val longFormDid = PrismDID.buildLongFormFromOperation(createOperation)
// // val canonicalDid = longFormDid.asCanonical
//
// val didMetadata =
// DIDMetadata(
// lastOperationHash = ArraySeq.from(longFormDid.stateHash.toByteArray),
// canonicalId = None, // unpublished DID must not contain canonicalId
// deactivated = false, // unpublished DID cannot be deactivated
// created = None, // unpublished DID cannot have timestamp
// updated = None // unpublished DID cannot have timestamp
// )
// val didData = DIDData(
// id = longFormDid.asCanonical,
// publicKeys = createOperation.publicKeys.collect { case pk: PublicKey => pk },
// services = createOperation.services,
// internalKeys = createOperation.publicKeys.collect { case pk: InternalPublicKey => pk },
// context = createOperation.context
// )
// (createOperation, keyPair, didMetadata, didData)
// }

def resolveDIDExpectation(didMetadata: DIDMetadata, didData: DIDData): Expectation[DIDService] =
MockDIDService.ResolveDID(
Expand Down

0 comments on commit e0ad6ae

Please sign in to comment.