Skip to content

Commit 6670d35

Browse files
committed
cleanup
1 parent 6f1c741 commit 6670d35

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

Thirdweb/Thirdweb.Extensions/ThirdwebExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ public static async Task<T> Authenticate<T>(
274274

275275
_ = payloadResponse.EnsureSuccessStatusCode();
276276
var payloadString = await payloadResponse.Content.ReadAsStringAsync();
277-
Console.WriteLine(payloadString);
278277

279278
var loginBodyRaw = JsonConvert.DeserializeObject<LoginPayload>(payloadString);
280279
if (loginBodyRaw.Payload == null)

Thirdweb/Thirdweb.Wallets/SmartWallet/SmartWallet.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ private async Task<object> SignUserOp(ThirdwebTransactionInput transactionInput,
426426
}
427427
else
428428
{
429-
var res = await this.GetPaymasterAndData(requestId, EncodeUserOperation(partialUserOp), true);
429+
var res = await this.GetPaymasterAndData(requestId, EncodeUserOperation(partialUserOp), simulation);
430430
partialUserOp.Paymaster = res.Paymaster;
431431
partialUserOp.PaymasterData = res.PaymasterData?.HexToBytes() ?? Array.Empty<byte>();
432432
partialUserOp.PreVerificationGas = new HexBigInteger(res.PreVerificationGas ?? "0").Value;
@@ -718,7 +718,7 @@ public async Task<string> PersonalSign(string message)
718718
: await this._personalAccount.PersonalSign(originalMsgHash);
719719

720720
var isValid = await this.IsValidSignature(message, sig);
721-
return isValid ? sig : throw new Exception("Invalid signature.");
721+
return isValid ? sig : throw new Exception("Invalid signature. Outside of the signer being incorrect, this can happen if the caller if not an approved target.");
722722
}
723723
else
724724
{
@@ -733,16 +733,13 @@ public async Task<string> RecoverAddressFromPersonalSign(string message, string
733733

734734
public async Task<bool> IsValidSignature(string message, string signature)
735735
{
736-
Console.WriteLine($"IsValidSignature: {message}, {signature}");
737-
738736
try
739737
{
740738
var magicValue = await ThirdwebContract.Read<byte[]>(this._accountContract, "isValidSignature", Encoding.UTF8.GetBytes(message).HashPrefixedMessage(), signature.HexToBytes());
741739
return magicValue.BytesToHex() == new byte[] { 0x16, 0x26, 0xba, 0x7e }.BytesToHex();
742740
}
743-
catch (Exception e)
741+
catch
744742
{
745-
Console.WriteLine("Error calling isValidSignature: " + e.Message);
746743
return false;
747744
}
748745
}

Thirdweb/Thirdweb.Wallets/SmartWallet/Thirdweb.AccountAbstraction/BundlerClient.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,6 @@ private static async Task<RpcResponseMessage> BundlerRequest(ThirdwebClient clie
8989
var requestMessage = new RpcRequestMessage(requestId, method, args = args.Where(a => a != null).ToArray());
9090
var requestMessageJson = JsonConvert.SerializeObject(requestMessage);
9191

92-
#if DEBUG
93-
Console.WriteLine($"Bundler Request {url}: {requestMessageJson}");
94-
#endif
95-
9692
var httpContent = new StringContent(requestMessageJson, System.Text.Encoding.UTF8, "application/json");
9793

9894
ThirdwebHttpResponseMessage httpResponse;
@@ -112,10 +108,6 @@ private static async Task<RpcResponseMessage> BundlerRequest(ThirdwebClient clie
112108

113109
var httpResponseJson = await httpResponse.Content.ReadAsStringAsync();
114110

115-
#if DEBUG
116-
Console.WriteLine($"Bundler Response: {httpResponseJson}");
117-
#endif
118-
119111
var response = JsonConvert.DeserializeObject<RpcResponseMessage>(httpResponseJson);
120112
return response.Error != null ? throw new Exception($"Bundler Request Failed. Error: {response.Error.Code} - {response.Error.Message} - {response.Error.Data}") : response;
121113
}

0 commit comments

Comments
 (0)