mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
use maketx
This commit is contained in:
parent
9d717a1d8c
commit
cf7252e2bc
1 changed files with 1 additions and 3 deletions
|
|
@ -768,9 +768,7 @@ func TestLogsSubscription(t *testing.T) {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
blocks, _ := core.GenerateChain(genesis.Config, genesis.ToBlock(), ethash.NewFaker(), db, 4, func(i int, b *core.BlockGen) {
|
blocks, _ := core.GenerateChain(genesis.Config, genesis.ToBlock(), ethash.NewFaker(), db, 4, func(i int, b *core.BlockGen) {
|
||||||
// transfer(address to, uint256 value)
|
tx := makeTx(i+1, i+11, b)
|
||||||
data := fmt.Sprintf("0xa9059cbb%s%s", common.HexToHash(common.BigToAddress(big.NewInt(int64(i + 1))).Hex()).String()[2:], common.BytesToHash([]byte{byte(i + 11)}).String()[2:])
|
|
||||||
tx, _ := types.SignTx(types.NewTx(&types.LegacyTx{Nonce: uint64(i), To: &contract, Value: big.NewInt(0), Gas: 46000, GasPrice: b.BaseFee(), Data: common.FromHex(data)}), signer, key)
|
|
||||||
b.AddTx(tx)
|
b.AddTx(tx)
|
||||||
})
|
})
|
||||||
bc, err := core.NewBlockChain(db, genesis, ethash.NewFaker(), nil)
|
bc, err := core.NewBlockChain(db, genesis, ethash.NewFaker(), nil)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue