File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -91,8 +91,17 @@ func TestWalletCountLimitDoesNotBlockExistingWalletAccess(t *testing.T) {
9191 // to access the existing wallet.
9292
9393 // Reset the database to have just 1 wallet initially
94- // Remove the second wallet created in the setup
95- db .Delete ([]byte (WalletStorageKey (user .Address , addr2 .Hex ())))
94+ // Clean up any wallets that might have been created by previous subtests (e.g., ListWallets)
95+ // by deleting all wallets and recreating just wallet1
96+ dbItems , err := db .GetByPrefix (WalletByOwnerPrefix (user .Address ))
97+ require .NoError (t , err )
98+ for _ , item := range dbItems {
99+ db .Delete (item .Key )
100+ }
101+
102+ // Recreate wallet1 to ensure clean state
103+ err = StoreWallet (db , user .Address , wallet1 )
104+ require .NoError (t , err )
96105
97106 // Now we have 1 wallet (limit=2), so we can create one more
98107 // First, call GetWallet to create a wallet with salt=999 (this should succeed)
You can’t perform that action at this time.
0 commit comments