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

feat: castor create signed prism did operation #347

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

elribonazo
Copy link
Contributor

@elribonazo elribonazo commented Nov 30, 2024

Description:

Implemented sign operation in castor, which enables the SDK to create and publish a prism did using cip-30, any wallet really out there can now sign this operations and publish them onchain.

Also fixed wrong signatures in Apollo, we were not able to create a proper DER encoded secp256k1 signature, causing an issue on publishing the transaction.

published did in mainnet here

Checklist:

  • My PR follows the contribution guidelines of this project
  • My PR is free of third-party dependencies that don't comply with the Allowlist
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked the PR title to follow the conventional commit specification

@elribonazo elribonazo force-pushed the features/issuer-poc branch 3 times, most recently from 587501a to 27f5263 Compare December 4, 2024 13:33
@elribonazo elribonazo marked this pull request as ready for review December 4, 2024 13:33
@elribonazo elribonazo requested a review from a team as a code owner December 4, 2024 13:33
@elribonazo elribonazo force-pushed the features/issuer-poc branch 3 times, most recently from 1a58c32 to a238d85 Compare December 4, 2024 14:00
Signed-off-by: Francisco Javier Ribo Labrador <[email protected]>
Signed-off-by: Francisco Javier Ribo Labrador <[email protected]>
Signed-off-by: Francisco Javier Ribo Labrador <[email protected]>
Signed-off-by: Francisco Javier Ribo Labrador <[email protected]>
Signed-off-by: Francisco Javier Ribo Labrador <[email protected]>
Signed-off-by: Francisco Javier Ribo Labrador <[email protected]>
Copy link

github-actions bot commented Dec 4, 2024

Lines Statements Branches Functions
Coverage: 76%
76.52% (3644/4762) 66.78% (1665/2493) 80.39% (865/1076)

@coveralls
Copy link

Pull Request Test Coverage Report for Build 12161414747

Details

  • 29 of 39 (74.36%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.4%) to 72.942%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/castor/Castor.ts 28 38 73.68%
Totals Coverage Status
Change from base Build 12028313717: 0.4%
Covered Lines: 3535
Relevant Lines: 4636

💛 - Coveralls

interface ProcessEnv {
NEXT_PUBLIC_BLOCKFROST_API_KEY: string;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure this belongs on the project root, isn't it demo specific?

* @param {PublicKey[]} issuanceKeys
* @returns {Promise<{operationHex: string, metadataBody: {v: number, c: string[]}, did: DID}>}
*/
async createOperation(
Copy link
Contributor

@curtis-h curtis-h Dec 11, 2024

Choose a reason for hiding this comment

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

can we improve this name? "Operation" feels a bit vague?

const stateHashHex = Buffer.from(encodedStateHash).toString("hex");
const base64State = base64.base64url.baseEncode(encodedState);
const methodSpecificId = PrismDID.parseMethodId([stateHashHex, base64State]);
const did = new DID("did", "prism", methodSpecificId.toString());
Copy link
Contributor

Choose a reason for hiding this comment

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

if we're returning a prismDID shouldn't the createPrismDID function handle that?

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.

3 participants