-
Notifications
You must be signed in to change notification settings - Fork 27
feat: identity class #815
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: identity class #815
Conversation
3dc8af4
to
3e46424
Compare
e2245cf
to
f382943
Compare
3127f68
to
02e6419
Compare
* @param keypairs | ||
* @returns The (in-place) modified Identity object for chaining. | ||
*/ | ||
addKeypair: (...keypairs: Array<Keypair | KeyringPair>) => Promise<Identity> |
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.
this name may be problematic; if I implement a method that helps rotate or add public keys to the DID document, these namings may clash
resolver?: typeof resolve | ||
transactionStrategy: TransactionStrategy<T> | ||
}): Promise<T> | ||
export async function makeIdentity<T extends IdentityClass>({ |
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.
there's makeIdentity
and newIdentity
; names could be improved to distinguish them better.
T extends IdentityClass & | ||
Required<Pick<Identity, 'submitTx' | 'submitterAddress'>> | ||
>(args: { | ||
keys: TypedKeyPair | TypedKeyPairs |
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.
this parameter could accept signers too; but the name would have to change. I don't like it anyway though - it's too similar but different from the keypairs
parameter of makeIdentity
tests/bundle/bundle-test.ts
Outdated
signers: [...(await aliceSign(alice)), payerSigner], | ||
submitterAccount: payerSigner.id, | ||
}) | ||
const issued = await Issuer.issue(credential, alice as any) |
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’m used to seeing this test as an example of real-life usage of the SDK. As an SDK user I won’t be happy to write as any
in my code. Is this an indication of an issue? (pun intended)
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.
ah, probably a leftover, I don't think it's necessary
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.
But more generally, what do you think about the overall approach to interacting with identity primitives here? Is this something you would have liked to implement sporran and SKYC on?
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 think my judgement is currently clouded by the pain of seeing the bundle-test in its current state. I believe it should be talked over.
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.
Yeah, would love to chat, because right now I wouldn't really know what to change here
ca0760b
to
1e578db
Compare
3621338
to
4643d4a
Compare
{ secretKey: encPublicKey, publicKey: encPublicKey, type: 'x25519' }, | ||
], | ||
}, | ||
}) | ||
const address = api.createType('Address', authPublicKey).toString() |
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.
How does this work? I tried using this but failed.
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.
The api throws an error back that it has a secret key.
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.
If I pass only the publickey I get my address.
@rflechtner Can we close this? |
I do believe this is superseded by #881, so I'll close this PR. Please do not delete the branch though, as we may want to cherry-pick some features - especially the |
closes kiltprotocol/ticket#3043
TODOs
authorizeTx
,submitTx
, andupdate
.