Skip to content

Commit 602e6eb

Browse files
committed
Update guest account logic and codecov ignore paths
Improved GetGuestAccount in BaseTests to ensure a fresh guest session by disconnecting if already connected and using a new session ID. Also updated codecov.yml to adjust ignored paths, removing Thirdweb.Pay and reordering entries.
1 parent 8c45dc2 commit 602e6eb

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Thirdweb.Tests/BaseTests.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,19 @@ public void DotEnvTest()
3232

3333
public async Task<IThirdwebWallet> GetGuestAccount()
3434
{
35-
return await InAppWallet.Create(this.Client, authProvider: AuthProvider.Guest);
35+
var iaw = await InAppWallet.Create(this.Client, authProvider: AuthProvider.Guest);
36+
if (await iaw.IsConnected())
37+
{
38+
await iaw.Disconnect();
39+
}
40+
_ = iaw.LoginWithGuest(defaultSessionIdOverride: Guid.NewGuid().ToString());
41+
return iaw;
3642
}
3743

3844
public async Task<SmartWallet> GetSmartAccount(int chainId = 421614)
3945
{
40-
var privateKeyAccount = await this.GetGuestAccount();
41-
var smartAccount = await SmartWallet.Create(personalWallet: privateKeyAccount, chainId: chainId);
46+
var guestAccount = await this.GetGuestAccount();
47+
var smartAccount = await SmartWallet.Create(personalWallet: guestAccount, chainId: chainId);
4248
return smartAccount;
4349
}
4450
}

codecov.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
ignore:
22
- "Thirdweb/Thirdweb.Wallets/InAppWallet"
3-
- "Thirdweb/Thirdweb.Pay"
4-
- "Thirdweb/Thirdweb.Api"
3+
- "Thirdweb/Thirdweb.Api"

0 commit comments

Comments
 (0)