Skip to content

Commit fd18d3d

Browse files
authored
AA 0.7 edge case Task.WhenAll undeployed acc AA10 (#70)
1 parent 9fbde4a commit fd18d3d

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

Thirdweb.Tests/Thirdweb.RPC/Thirdweb.RPC.Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public async Task TestCache()
7979
await ThirdwebTask.Delay(1);
8080
var blockNumber2 = await rpc.SendRequestAsync<string>("eth_blockNumber");
8181
Assert.Equal(blockNumber1, blockNumber2);
82-
await ThirdwebTask.Delay(100);
82+
await ThirdwebTask.Delay(1000);
8383
var blockNumber3 = await rpc.SendRequestAsync<string>("eth_blockNumber");
8484
Assert.NotEqual(blockNumber1, blockNumber3);
8585
}

Thirdweb.Tests/Thirdweb.Wallets/Thirdweb.SmartWallet.Tests.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,27 @@ public async Task SendTransaction_07_Success()
286286
Assert.True(hash07.Length == 66);
287287
}
288288

289+
[Fact(Timeout = 120000)]
290+
public async Task ExecuteTransaction_07_WhenAll_Success()
291+
{
292+
var smartWallet07 = await SmartWallet.Create(
293+
personalWallet: await PrivateKeyWallet.Generate(this.Client),
294+
chainId: 11155111,
295+
gasless: true,
296+
factoryAddress: "0xc5A43D081Dc10316EE640504Ea1cBc74666F3874",
297+
entryPoint: Constants.ENTRYPOINT_ADDRESS_V07
298+
);
299+
300+
var hash07 = smartWallet07.ExecuteTransaction(new ThirdwebTransactionInput(11155111) { To = await smartWallet07.GetAddress(), });
301+
var hash07_2 = smartWallet07.ExecuteTransaction(new ThirdwebTransactionInput(11155111) { To = await smartWallet07.GetAddress(), });
302+
303+
var hashes = await Task.WhenAll(hash07, hash07_2);
304+
305+
Assert.True(hashes.Length == 2);
306+
Assert.True(hashes[0].TransactionHash.Length == 66);
307+
Assert.True(hashes[1].TransactionHash.Length == 66);
308+
}
309+
289310
[Fact(Timeout = 120000)]
290311
public async Task MultiChainTransaction_Success()
291312
{

Thirdweb/Thirdweb.Wallets/SmartWallet/SmartWallet.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ private async Task<object> SignUserOp(ThirdwebTransactionInput transactionInput,
333333
if (this.IsDeploying)
334334
{
335335
initCode = Array.Empty<byte>();
336+
factory = null;
337+
factoryData = null;
336338
}
337339

338340
while (this.IsDeploying)

0 commit comments

Comments
 (0)