Skip to content

Commit 1c35262

Browse files
minor cleanup
1 parent 57b74e8 commit 1c35262

File tree

2 files changed

+30
-24
lines changed

2 files changed

+30
-24
lines changed

Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebCreateSessionKey.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ void UAsyncTaskThirdwebCreateSessionKey::Activate()
1717
);
1818
}
1919

20-
UAsyncTaskThirdwebCreateSessionKey* UAsyncTaskThirdwebCreateSessionKey::CreateSessionKey(UObject* WorldContextObject,
21-
const FSmartWalletHandle& Wallet,
22-
const FString& Signer,
23-
const TArray<FString>& ApprovedTargets,
24-
const FString& NativeTokenLimitPerTransactionInWei,
25-
const FDateTime& PermissionEnd)
20+
UAsyncTaskThirdwebCreateSessionKey* UAsyncTaskThirdwebCreateSessionKey::CreateSessionKey(
21+
UObject* WorldContextObject,
22+
const FSmartWalletHandle& Wallet,
23+
const FString& Signer,
24+
const TArray<FString>& ApprovedTargets,
25+
const FString& NativeTokenLimitPerTransactionInWei,
26+
const FDateTime& PermissionEnd
27+
)
2628
{
2729
if (!WorldContextObject)
2830
{
@@ -54,7 +56,7 @@ void UAsyncTaskThirdwebCreateSessionKey::HandleResponse(const FString& TxHash)
5456
}, TStatId(), nullptr, ENamedThreads::GameThread);
5557
return;
5658
}
57-
59+
5860
Success.Broadcast(TxHash, TEXT(""));
5961
SetReadyToDestroy();
6062
}

Source/Thirdweb/Private/Wallets/ThirdwebSmartWalletHandle.cpp

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void FSmartWalletHandle::Create(const FInAppWalletHandle& InInAppWallet,
4343
const FStringDelegate& ErrorDelegate)
4444
{
4545
CHECK_DELEGATES(SuccessDelegate, ErrorDelegate);
46-
46+
4747
if (!InInAppWallet.IsValid())
4848
{
4949
if (ErrorDelegate.IsBound())
@@ -52,7 +52,7 @@ void FSmartWalletHandle::Create(const FInAppWalletHandle& InInAppWallet,
5252
}
5353
return;
5454
}
55-
55+
5656
UE::Tasks::Launch(UE_SOURCE_LOCATION, [InInAppWallet, ChainID, bGasless, Factory, AccountOverride, SuccessDelegate, ErrorDelegate]
5757
{
5858
if (FString Error; Thirdweb::create_smart_wallet(
@@ -84,7 +84,7 @@ void FSmartWalletHandle::IsDeployed(const FBoolDelegate& SuccessDelegate, const
8484
{
8585
CHECK_DELEGATES(SuccessDelegate, ErrorDelegate);
8686
CHECK_VALIDITY(ErrorDelegate);
87-
87+
8888
FSmartWalletHandle ThisCopy = *this;
8989
UE::Tasks::Launch(UE_SOURCE_LOCATION, [ThisCopy, SuccessDelegate, ErrorDelegate]
9090
{
@@ -99,16 +99,18 @@ void FSmartWalletHandle::IsDeployed(const FBoolDelegate& SuccessDelegate, const
9999
});
100100
}
101101

102-
void FSmartWalletHandle::CreateSessionKey(const FString& Signer,
103-
const TArray<FString>& ApprovedTargets,
104-
const FString& NativeTokenLimitPerTransactionInWei,
105-
const FDateTime& PermissionEnd,
106-
const FStringDelegate& SuccessDelegate,
107-
const FStringDelegate& ErrorDelegate)
102+
void FSmartWalletHandle::CreateSessionKey(
103+
const FString& Signer,
104+
const TArray<FString>& ApprovedTargets,
105+
const FString& NativeTokenLimitPerTransactionInWei,
106+
const FDateTime& PermissionEnd,
107+
const FStringDelegate& SuccessDelegate,
108+
const FStringDelegate& ErrorDelegate
109+
)
108110
{
109111
CHECK_DELEGATES(SuccessDelegate, ErrorDelegate);
110112
CHECK_VALIDITY(ErrorDelegate);
111-
113+
112114
FDateTime TenYearsFromNow = FDateTime::UtcNow() + FTimespan::FromDays(10 * 365);
113115
FDateTime EndTime = TenYearsFromNow;
114116
TArray<const char*> ApprovedTargetsCArray;
@@ -167,7 +169,7 @@ void FSmartWalletHandle::RevokeSessionKey(const FString& Signer, const FSimpleDe
167169
{
168170
CHECK_DELEGATES(SuccessDelegate, ErrorDelegate);
169171
CHECK_VALIDITY(ErrorDelegate);
170-
172+
171173
FSmartWalletHandle ThisCopy = *this;
172174
UE::Tasks::Launch(UE_SOURCE_LOCATION, [ThisCopy, Signer, SuccessDelegate, ErrorDelegate]
173175
{
@@ -186,7 +188,7 @@ void FSmartWalletHandle::GetAdmins(const FStringArrayDelegate& SuccessDelegate,
186188
{
187189
CHECK_DELEGATES(SuccessDelegate, ErrorDelegate);
188190
CHECK_VALIDITY(ErrorDelegate);
189-
191+
190192
FSmartWalletHandle ThisCopy = *this;
191193
UE::Tasks::Launch(UE_SOURCE_LOCATION, [ThisCopy, SuccessDelegate, ErrorDelegate]
192194
{
@@ -219,14 +221,15 @@ void FSmartWalletHandle::AddAdmin(const FString& Signer, const FSimpleDelegate&
219221
{
220222
CHECK_DELEGATES(SuccessDelegate, ErrorDelegate);
221223
CHECK_VALIDITY(ErrorDelegate);
222-
224+
223225
FSmartWalletHandle ThisCopy = *this;
224226
UE::Tasks::Launch(UE_SOURCE_LOCATION, [ThisCopy, Signer, SuccessDelegate, ErrorDelegate]
225227
{
226228
if (FString Error; Thirdweb::smart_wallet_add_admin(ThisCopy.GetID(), TO_RUST_STRING(Signer)).AssignResult(Error))
227229
{
228230
SuccessDelegate.Execute();
229-
} else
231+
}
232+
else
230233
{
231234
ErrorDelegate.Execute(Error);
232235
}
@@ -237,14 +240,15 @@ void FSmartWalletHandle::RemoveAdmin(const FString& Signer, const FSimpleDelegat
237240
{
238241
CHECK_DELEGATES(SuccessDelegate, ErrorDelegate);
239242
CHECK_VALIDITY(ErrorDelegate);
240-
243+
241244
FSmartWalletHandle ThisCopy = *this;
242245
UE::Tasks::Launch(UE_SOURCE_LOCATION, [ThisCopy, Signer, SuccessDelegate, ErrorDelegate]
243246
{
244247
if (FString Error; Thirdweb::smart_wallet_remove_admin(ThisCopy.GetID(), TO_RUST_STRING(Signer)).AssignResult(Error))
245248
{
246249
SuccessDelegate.Execute();
247-
} else
250+
}
251+
else
248252
{
249253
ErrorDelegate.Execute(Error);
250254
}
@@ -255,7 +259,7 @@ void FSmartWalletHandle::GetActiveSigners(const FGetActiveSignersDelegate& Succe
255259
{
256260
CHECK_DELEGATES(SuccessDelegate, ErrorDelegate);
257261
CHECK_VALIDITY(ErrorDelegate);
258-
262+
259263
FSmartWalletHandle ThisCopy = *this;
260264
UE::Tasks::Launch(UE_SOURCE_LOCATION, [ThisCopy, SuccessDelegate, ErrorDelegate]
261265
{

0 commit comments

Comments
 (0)