eth/tracers: use types.NewTx instead

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
jsvisa 2023-11-29 22:38:09 +08:00
parent a5d05ad71f
commit d8aad5e8f2

View file

@ -205,18 +205,39 @@ func TestTraceCall(t *testing.T) {
// Transfer from account[0] to account[1] // Transfer from account[0] to account[1]
// value: 1000 wei // value: 1000 wei
// fee: 0 wei // fee: 0 wei
tx, _ := types.SignTx(types.NewTransaction(nonce, accounts[1].addr, big.NewInt(1000), params.TxGas, b.BaseFee(), nil), signer, accounts[0].key) tx, _ := types.SignTx(types.NewTx(&types.LegacyTx{
Nonce: nonce,
To: &accounts[1].addr,
Value: big.NewInt(1000),
Gas: params.TxGas,
GasPrice: b.BaseFee(),
Data: nil}),
signer, accounts[0].key)
b.AddTx(tx) b.AddTx(tx)
nonce++ nonce++
if i == genBlocks-2 { if i == genBlocks-2 {
// Transfer from account[0] to account[2] // Transfer from account[0] to account[2]
tx, _ = types.SignTx(types.NewTransaction(nonce, accounts[2].addr, big.NewInt(1000), params.TxGas, b.BaseFee(), nil), signer, accounts[0].key) tx, _ = types.SignTx(types.NewTx(&types.LegacyTx{
Nonce: nonce,
To: &accounts[2].addr,
Value: big.NewInt(1000),
Gas: params.TxGas,
GasPrice: b.BaseFee(),
Data: nil}),
signer, accounts[0].key)
b.AddTx(tx) b.AddTx(tx)
nonce++ nonce++
// Transfer from account[0] to account[1] again // Transfer from account[0] to account[1] again
tx, _ = types.SignTx(types.NewTransaction(nonce, accounts[1].addr, big.NewInt(1000), params.TxGas, b.BaseFee(), nil), signer, accounts[0].key) tx, _ = types.SignTx(types.NewTx(&types.LegacyTx{
Nonce: nonce,
To: &accounts[1].addr,
Value: big.NewInt(1000),
Gas: params.TxGas,
GasPrice: b.BaseFee(),
Data: nil}),
signer, accounts[0].key)
b.AddTx(tx) b.AddTx(tx)
nonce++ nonce++
} }