Skip to content

Commit

Permalink
Generated code from proto files (#844)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub <github-action@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and GitHub committed Jul 5, 2022
1 parent 3e820da commit d9a88c4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
13 changes: 8 additions & 5 deletions dart/example/vaccine_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ Future runVaccineDemo() async {
var credentialJson = await vaccineCertFile.readAsString();

// issueCredential() {
var issueResponse =
await trinsic.credential().issue(IssueRequest(documentJson: credentialJson));
var issueResponse = await trinsic
.credential()
.issue(IssueRequest(documentJson: credentialJson));
// }
var credential = issueResponse.signedDocumentJson;
print("Credential: $credential");
Expand All @@ -69,8 +70,9 @@ Future runVaccineDemo() async {
// Alice stores the credential in her cloud wallet.
trinsic.serviceOptions.authToken = allison;
// insertItemWallet() {
var insertResponse =
await trinsic.wallet().insertItem(InsertItemRequest(itemJson: credential));
var insertResponse = await trinsic
.wallet()
.insertItem(InsertItemRequest(itemJson: credential));
// }
var itemId = insertResponse.itemId;
// }
Expand All @@ -94,7 +96,8 @@ Future runVaccineDemo() async {
// The airline verifies the credential
trinsic.serviceOptions.authToken = airline;
// verifyProof() {
var verifyResult = await trinsic.credential()
var verifyResult = await trinsic
.credential()
.verifyProof(VerifyProofRequest(proofDocumentJson: credentialProof));
// }
var valid = verifyResult.isValid;
Expand Down
5 changes: 2 additions & 3 deletions dart/lib/src/account_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ class AccountService extends ServiceBase {

Future<String> signIn({SignInRequest? request}) async {
request ??= SignInRequest();
request.ecosystemId = request.ecosystemId != ""
? request.ecosystemId
: "default";
request.ecosystemId =
request.ecosystemId != "" ? request.ecosystemId : "default";
SignInResponse response = await client.signIn(request);
var authToken =
Base64Encoder.urlSafe().convert(response.profile.writeToBuffer());
Expand Down
4 changes: 1 addition & 3 deletions python/trinsic/account_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ async def sign_in(self, *, request: SignInRequest = None) -> str:
Deprecated - use `AccountService.login` and `AccountService.login_confirm` instead
"""
request = request or SignInRequest()
request.ecosystem_id = (
request.ecosystem_id or "default"
)
request.ecosystem_id = request.ecosystem_id or "default"
response = await self.client.sign_in(sign_in_request=request)
auth_token = base64.urlsafe_b64encode(bytes(response.profile)).decode("utf-8")
self.service_options.auth_token = auth_token
Expand Down

0 comments on commit d9a88c4

Please sign in to comment.