Skip to content

Commit 2e9a82a

Browse files
Python account signin simplify (#373)
1 parent 0a12a6d commit 2e9a82a

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

python/samples/ecosystem_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
async def ecosystem_demo():
88
account_service = AccountService(server_config=trinsic_test_config())
9-
account_profile, _ = await account_service.sign_in()
9+
account_profile = await account_service.sign_in()
1010
provider_service = ProviderService(account_profile, trinsic_test_config(), account_service.channel)
1111
actual_create = await provider_service.create_ecosystem(name="Test Ecosystem", description="My ecosystem", uri="https://example.com")
1212
assert actual_create is not None

python/samples/templates_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
async def templates_demo():
1212
account_service = AccountService(server_config=trinsic_test_config())
13-
profile, _ = await account_service.sign_in()
13+
profile = await account_service.sign_in()
1414
template_service = CredentialTemplatesService(profile, trinsic_test_config())
1515
credential_service = CredentialsService(profile, trinsic_test_config())
1616

python/samples/trustregistry_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
async def trustregistry_demo():
99
# setup
1010
account_service = AccountService(server_config=trinsic_test_config())
11-
account, _ = await account_service.sign_in()
11+
account = await account_service.sign_in()
1212
service = TrustRegistryService(account, trinsic_test_config())
1313

1414
# data

python/samples/vaccine_demo.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ async def vaccine_demo():
2828

2929
# setupActors() {
3030
# Create 3 different profiles for each participant in the scenario
31-
allison, _ = await account_service.sign_in()
32-
clinic, _ = await account_service.sign_in()
33-
airline, _ = await account_service.sign_in()
31+
allison = await account_service.sign_in()
32+
clinic = await account_service.sign_in()
33+
airline = await account_service.sign_in()
3434
# }
3535

3636
account_service.profile = clinic
3737
info = await account_service.get_info()
38+
print(f"Account info={info}")
3839

3940
# createService() {
4041
wallet_service = WalletService(allison, account_service.channel)

python/tests/test_trinsic_services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async def test_code():
6767
def test_protect_unprotect_account(self):
6868
async def test_code():
6969
account_service = AccountService(None, trinsic_test_config())
70-
my_profile, _ = await account_service.sign_in()
70+
my_profile = await account_service.sign_in()
7171
await self.print_get_info(account_service, my_profile)
7272

7373
code = b"1234"

python/trinsic/services.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,15 @@ def __init__(self, profile: AccountProfile = None, server_config: ServerConfig =
4141
super().__init__(profile, server_config, channel)
4242
self.client: AccountStub = self.stub_with_metadata(AccountStub)
4343

44-
async def sign_in(self, details: AccountDetails = AccountDetails(email='')) -> Tuple[
45-
AccountProfile, ConfirmationMethod]:
44+
async def sign_in(self, details: AccountDetails = AccountDetails(email='')) -> AccountProfile:
4645
"""
4746
Perform a sign-in to obtain an account profile. If the `AccountDetails` are specified, they will be used to associate
4847
Args:
4948
details:
5049
Returns:
5150
"""
5251
response = await self.client.sign_in(details=details)
53-
return response.profile, response.confirmation_method
52+
return response.profile
5453

5554
@staticmethod
5655
def unprotect(profile: AccountProfile, security_code: Union[SupportsBytes, bytes, str]) -> AccountProfile:

0 commit comments

Comments
 (0)