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

Convenience methods #5

Open
van-ibm opened this issue May 6, 2019 · 0 comments
Open

Convenience methods #5

van-ibm opened this issue May 6, 2019 · 0 comments

Comments

@van-ibm
Copy link
Contributor

van-ibm commented May 6, 2019

As I was writing tests, I thought of instances where a convenience method would more clearly match a function with its semantics. If a holder were requesting a credential from an issuer, the issuer must execute .getCredentials({state: 'inbound_request'}) to obtain such requests. That could be rewritten as:

function getCredentialRequests() {
 return getCredentials({state: 'inbound_request'});
}

This obviously does not save the developer from a lot of implementation, but the functions might more naturally align to the vocabulary /mechanics of SSI, which could facilitate understanding for new users.

Some other candidates (basically anything with a state property):

holder.getVerifications({state: 'inbound_proof_request'});
holder.updateVerification(verification.id, 'proof_generated');
holder.updateVerification(verification.id, 'proof_shared');
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

No branches or pull requests

1 participant