Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Shailu-s committed Dec 6, 2024
1 parent ae96131 commit 60b28b6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion sequencer/api/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type rollupConstants struct {
}

type configAPI struct {
ChainID uint16 `json:"chainId"`
ChainID uint64 `json:"chainId"`
RollupConstants rollupConstants `json:"hermez"`
}

Expand Down
16 changes: 8 additions & 8 deletions sequencer/database/historydb/historydb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func TestBlocks(t *testing.T) {
> block // blockNum=5
> block // blockNum=6
`
tc := til.NewContext(uint16(0), 1)
tc := til.NewContext(uint64(0), 1)
blocks, err := tc.GenerateBlocks(set1)
require.NoError(t, err)
// Save timestamp of a block with UTC and change it without UTC
Expand Down Expand Up @@ -142,7 +142,7 @@ func TestBatches(t *testing.T) {
> batch // batchNum=4, L2 only batch, forges delteVouch
> block
`
tc := til.NewContext(uint16(0), common.RollupConstMaxL1UserTx)
tc := til.NewContext(uint64(0), common.RollupConstMaxL1UserTx)
tilCfgExtra := til.ConfigExtra{
BootCoordAddr: ethCommon.HexToAddress("0xE39fEc6224708f0772D2A74fd3f9055A90E0A9f2"),
CoordUser: "A",
Expand Down Expand Up @@ -299,7 +299,7 @@ func TestTxs(t *testing.T) {
// > block // block 7
`

tc := til.NewContext(uint16(0), common.RollupConstMaxL1UserTx)
tc := til.NewContext(uint64(0), common.RollupConstMaxL1UserTx)
tilCfgExtra := til.ConfigExtra{
BootCoordAddr: ethCommon.HexToAddress("0xE39fEc6224708f0772D2A74fd3f9055A90E0A9f2"),
CoordUser: "A",
Expand Down Expand Up @@ -520,7 +520,7 @@ func TestGetUnforgedL1UserTxs(t *testing.T) {
> block
`
tc := til.NewContext(uint16(0), 128)
tc := til.NewContext(uint64(0), 128)
blocks, err := tc.GenerateBlocks(set)
require.NoError(t, err)
// Sanity check
Expand Down Expand Up @@ -631,7 +631,7 @@ func TestSetExtraInfoForgedL1UserTxs(t *testing.T) {
> block // blockNum=3
`

tc := til.NewContext(uint16(0), common.RollupConstMaxL1UserTx)
tc := til.NewContext(uint64(0), common.RollupConstMaxL1UserTx)
tilCfgExtra := til.ConfigExtra{
BootCoordAddr: ethCommon.HexToAddress("0xE39fEc6224708f0772D2A74fd3f9055A90E0A9f2"),
CoordUser: "A",
Expand Down Expand Up @@ -719,7 +719,7 @@ func TestUpdateExitTree(t *testing.T) {
> block // blockNum=5 (empty block)
`

tc := til.NewContext(uint16(0), common.RollupConstMaxL1UserTx)
tc := til.NewContext(uint64(0), common.RollupConstMaxL1UserTx)
tilCfgExtra := til.ConfigExtra{
BootCoordAddr: ethCommon.HexToAddress("0xE39fEc6224708f0772D2A74fd3f9055A90E0A9f2"),
CoordUser: "A",
Expand Down Expand Up @@ -860,7 +860,7 @@ func TestGetFirstBatchBlockNumBySlot(t *testing.T) {
> block // 13
`
tc := til.NewContext(uint16(0), common.RollupConstMaxL1UserTx)
tc := til.NewContext(uint64(0), common.RollupConstMaxL1UserTx)
blocks, err := tc.GenerateBlocks(set)
assert.NoError(t, err)

Expand Down Expand Up @@ -941,7 +941,7 @@ func TestTxItemID(t *testing.T) {
set = append(set, til.Instruction{Typ: til.TypeNewBatchL1})
set = append(set, til.Instruction{Typ: til.TypeNewBlock}) // block 33

var chainID uint16 = 0
var chainID uint64 = 0
tc := til.NewContext(chainID, common.RollupConstMaxL1UserTx)
blocks, err := tc.GenerateBlocksFromInstructions(set)
assert.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion sequencer/database/l2db/l2db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func prepareHistoryDB(historyDB *historydb.HistoryDB) error {
> block
`

tc = til.NewContext(uint16(0), common.RollupConstMaxL1UserTx)
tc = til.NewContext(uint64(0), common.RollupConstMaxL1UserTx)
tilCfgExtra := til.ConfigExtra{
BootCoordAddr: ethCommon.HexToAddress("0xE39fEc6224708f0772D2A74fd3f9055A90E0A9f2"),
CoordUser: "A",
Expand Down
2 changes: 1 addition & 1 deletion sequencer/synchronizer/synchronizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func assertEqualAccountsHistoryDBStateDB(t *testing.T, hdbAccs, sdbAccs []common
}
}

var chainID uint16 = 0
var chainID uint64 = 0
var deleteme = []string{}

func TestMain(m *testing.M) {
Expand Down
4 changes: 2 additions & 2 deletions sequencer/test/til/txs.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type Context struct {
// queued in a batch
rollupConstMaxL1UserTx int

chainID uint16
chainID uint64
idx int
currBlock common.BlockData
currBatch common.BatchData
Expand All @@ -77,7 +77,7 @@ type Context struct {
}

// NewContext returns a new Context
func NewContext(chainID uint16, rollupConstMaxL1UserTx int) *Context {
func NewContext(chainID uint64, rollupConstMaxL1UserTx int) *Context {
currBatchNum := 1 // The protocol defines the first batchNum to be 1
return &Context{
Accounts: make(map[string]*Account),
Expand Down

0 comments on commit 60b28b6

Please sign in to comment.