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()
4949 Assert . NotNull ( client . ClientId ) ;
5050 Assert . NotNull ( client . SecretKey ) ;
5151 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 ) ) ;
5454 Assert . Equal ( client . SecretKey , this . SecretKey ) ;
5555 }
5656
Original file line number Diff line number Diff line change @@ -42,16 +42,9 @@ private ThirdwebClient(
4242 throw new InvalidOperationException ( "ClientId or SecretKey must be provided" ) ;
4343 }
4444
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 ;
5548 this . BundleId = bundleId ;
5649
5750 this . FetchTimeoutOptions = fetchTimeoutOptions ?? new TimeoutOptions ( ) ;
You can’t perform that action at this time.
0 commit comments