Skip to content

Commit f1d10db

Browse files
committed
fix tests
1 parent 234e7e9 commit f1d10db

File tree

2 files changed

+12
-21
lines changed

2 files changed

+12
-21
lines changed

Thirdweb.Tests/Thirdweb.Wallets/Thirdweb.PrivateKeyWallet.Tests.cs

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -209,16 +209,16 @@ public async Task SignTypedDataV4_Typed_NullData()
209209
public async Task SignTransaction_Success()
210210
{
211211
var account = await this.GetAccount();
212-
var transaction = new ThirdwebTransactionInput(421614)
213-
{
214-
From = await account.GetAddress(),
215-
To = Constants.ADDRESS_ZERO,
216-
// Value = new HexBigInteger(0),
217-
Gas = new HexBigInteger(21000),
218-
// Data = "0x",
219-
Nonce = new HexBigInteger(99999999999),
220-
GasPrice = new HexBigInteger(10000000000),
221-
};
212+
var transaction = new ThirdwebTransactionInput(
213+
chainId: 421614,
214+
from: await account.GetAddress(),
215+
to: Constants.ADDRESS_ZERO,
216+
value: 0,
217+
gas: 21000,
218+
data: "0x",
219+
nonce: 99999999999,
220+
gasPrice: 10000000000
221+
);
222222
var signature = await account.SignTransaction(transaction);
223223
Assert.NotNull(signature);
224224
}
@@ -227,15 +227,7 @@ public async Task SignTransaction_Success()
227227
public async Task SignTransaction_NoFrom_Success()
228228
{
229229
var account = await this.GetAccount();
230-
var transaction = new ThirdwebTransactionInput(421614)
231-
{
232-
To = Constants.ADDRESS_ZERO,
233-
// Value = new HexBigInteger(0),
234-
Gas = new HexBigInteger(21000),
235-
Data = "0x",
236-
Nonce = new HexBigInteger(99999999999),
237-
GasPrice = new HexBigInteger(10000000000),
238-
};
230+
var transaction = new ThirdwebTransactionInput(chainId: 421614, to: Constants.ADDRESS_ZERO, value: 0, gas: 21000, data: "0x", nonce: 99999999999, gasPrice: 10000000000);
239231
var signature = await account.SignTransaction(transaction);
240232
Assert.NotNull(signature);
241233
}

Thirdweb/Thirdweb.Wallets/PrivateKeyWallet/PrivateKeyWallet.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,15 +307,14 @@ public virtual Task<string> SignTransaction(ThirdwebTransactionInput transaction
307307

308308
if (transaction.GasPrice != null)
309309
{
310-
var gasPrice = transaction.GasPrice;
311310
var legacySigner = new LegacyTransactionSigner();
312311
signedTransaction = legacySigner.SignTransaction(
313312
this.EcKey.GetPrivateKey(),
314313
transaction.ChainId.Value,
315314
transaction.To,
316315
transaction.Value.Value,
317316
transaction.Nonce.Value,
318-
gasPrice.Value,
317+
transaction.GasPrice.Value,
319318
transaction.Gas.Value,
320319
transaction.Data
321320
);

0 commit comments

Comments
 (0)