File tree Expand file tree Collapse file tree 2 files changed +5
-12
lines changed
Thirdweb.Tests/Thirdweb.Client Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -49,8 +49,8 @@ public void ClientIdAndSecretKeyInitialization()
49
49
Assert . NotNull ( client . ClientId ) ;
50
50
Assert . NotNull ( client . SecretKey ) ;
51
51
Assert . Null ( client . BundleId ) ;
52
- Assert . NotEqual ( client . ClientId , clientId ) ;
53
- Assert . Equal ( client . ClientId , Utils . ComputeClientIdFromSecretKey ( client . SecretKey ) ) ;
52
+ Assert . Equal ( client . ClientId , clientId ) ;
53
+ Assert . NotEqual ( client . ClientId , Utils . ComputeClientIdFromSecretKey ( client . SecretKey ) ) ;
54
54
Assert . Equal ( client . SecretKey , this . SecretKey ) ;
55
55
}
56
56
Original file line number Diff line number Diff line change @@ -42,16 +42,9 @@ private ThirdwebClient(
42
42
throw new InvalidOperationException ( "ClientId or SecretKey must be provided" ) ;
43
43
}
44
44
45
- if ( ! string . IsNullOrEmpty ( secretKey ) )
46
- {
47
- this . ClientId = Utils . ComputeClientIdFromSecretKey ( secretKey ) ;
48
- this . SecretKey = secretKey ;
49
- }
50
- else
51
- {
52
- this . ClientId = clientId ;
53
- }
54
-
45
+ // Respects provided clientId if any, otherwise computes it from secretKey
46
+ this . ClientId = ! string . IsNullOrEmpty ( clientId ) ? clientId : ( string . IsNullOrEmpty ( secretKey ) ? null : Utils . ComputeClientIdFromSecretKey ( secretKey ) ) ;
47
+ this . SecretKey = secretKey ;
55
48
this . BundleId = bundleId ;
56
49
57
50
this . FetchTimeoutOptions = fetchTimeoutOptions ?? new TimeoutOptions ( ) ;
You can’t perform that action at this time.
0 commit comments