forked from ethereum-optimism/optimism
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_test.go
37 lines (30 loc) · 1021 Bytes
/
setup_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
33
34
35
36
37
package e2eutils
import (
"encoding/hex"
"os"
"testing"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
)
func TestWriteDefaultJWT(t *testing.T) {
jwtPath := WriteDefaultJWT(t)
data, err := os.ReadFile(jwtPath)
require.NoError(t, err)
require.Equal(t, "0x"+hex.EncodeToString(testingJWTSecret[:]), string(data))
}
func TestSetup(t *testing.T) {
tp := &TestParams{
MaxSequencerDrift: 40,
SequencerWindowSize: 120,
ChannelTimeout: 120,
}
dp := MakeDeployParams(t, tp)
alloc := &AllocParams{PrefundTestUsers: true}
sd := Setup(t, dp, alloc)
require.Contains(t, sd.L1Cfg.Alloc, dp.Addresses.Alice)
require.Equal(t, sd.L1Cfg.Alloc[dp.Addresses.Alice].Balance, Ether(1e6))
require.Contains(t, sd.L2Cfg.Alloc, dp.Addresses.Alice)
require.Equal(t, sd.L2Cfg.Alloc[dp.Addresses.Alice].Balance, Ether(1e6))
require.Contains(t, sd.L1Cfg.Alloc, predeploys.DevOptimismPortalAddr)
require.Contains(t, sd.L2Cfg.Alloc, predeploys.L1BlockAddr)
}