forked from klimovich-x/DeBankChain
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
l2_gossip_test.go
32 lines (27 loc) · 968 Bytes
/
l2_gossip_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package op_e2e
import (
"testing"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/geth"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"
)
func TestTxGossip(t *testing.T) {
InitParallel(t)
cfg := DefaultSystemConfig(t)
gethOpts := []geth.GethOption{
geth.WithP2P(),
}
cfg.GethOptions["sequencer"] = append(cfg.GethOptions["sequencer"], gethOpts...)
cfg.GethOptions["verifier"] = append(cfg.GethOptions["verifier"], gethOpts...)
sys, err := cfg.Start(t)
require.NoError(t, err, "Start system")
seqClient := sys.Clients["sequencer"]
verifClient := sys.Clients["verifier"]
geth.ConnectP2P(t, seqClient, verifClient)
// Send a transaction to the verifier and it should be gossiped to the sequencer and included in a block.
SendL2Tx(t, cfg, verifClient, cfg.Secrets.Alice, func(opts *TxOpts) {
opts.ToAddr = &common.Address{0xaa}
opts.Value = common.Big1
opts.VerifyOnClients(seqClient, verifClient)
})
}