Skip to content

Commit

Permalink
comments on PR
Browse files Browse the repository at this point in the history
  • Loading branch information
joanestebanr committed Jul 24, 2024
1 parent fc95005 commit 3f2c709
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 67 deletions.
59 changes: 0 additions & 59 deletions etherman/contracts/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ package contracts

import (
"errors"
"fmt"
"math/big"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)

type NameType string
Expand All @@ -29,56 +23,3 @@ const (
VersionBanana VersionType = "banana"
VersionElderberry VersionType = "elderberry"
)

type RollupContractor interface {
TrustedSequencer() (common.Address, error)
TrustedSequencerURL() (string, error)
LastAccInputHash() (common.Hash, error)
DataAvailabilityProtocol() (common.Address, error)
}

type GlobalExitRootContractor interface {
// L1InfoIndexToRoot: get the root for a specific leaf index
L1InfoIndexToRoot(indexLeaf uint32) (common.Hash, error)
}

type BaseContractor interface {
Name() string
Version() string
Address() common.Address
String() string
}

type RollupData struct {
RollupContract common.Address
ChainID uint64
Verifier common.Address
ForkID uint64
LastLocalExitRoot [32]byte
LastBatchSequenced uint64
LastVerifiedBatch uint64
LastPendingState uint64
LastPendingStateConsolidated uint64
LastVerifiedBatchBeforeUpgrade uint64
RollupTypeID uint64
RollupCompatibilityID uint8
}

func (r *RollupData) String() string {
return fmt.Sprintf("RollupContract: %s, ChainID: %d, Verifier: %s, ForkID: %d, LastLocalExitRoot: %x, LastBatchSequenced: %d, LastVerifiedBatch: %d, LastPendingState: %d, LastPendingStateConsolidated: %d, LastVerifiedBatchBeforeUpgrade: %d, RollupTypeID: %d, RollupCompatibilityID: %d", r.RollupContract.String(), r.ChainID, r.Verifier.String(), r.ForkID, r.LastLocalExitRoot, r.LastBatchSequenced, r.LastVerifiedBatch, r.LastPendingState, r.LastPendingStateConsolidated, r.LastVerifiedBatchBeforeUpgrade, r.RollupTypeID, r.RollupCompatibilityID)
}

type StateVariablesSequencedBatchData struct {
AccInputHash [32]byte
SequencedTimestamp uint64
PreviousLastBatchSequenced uint64
}

type RollupManagerContractor interface {
BaseContractor
RollupAddressToID(rollupAddress common.Address) (uint32, error)
GetBatchFee() (*big.Int, error)
RollupIDToRollupData(rollupID uint32) (*RollupData, error)
VerifyBatchesTrustedAggregator(opts *bind.TransactOpts, rollupID uint32, pendingStateNum uint64, initNumBatch uint64, finalNewBatch uint64, newLocalExitRoot [32]byte, newStateRoot [32]byte, beneficiary common.Address, proof [24][32]byte) (*types.Transaction, error)
GetRollupSequencedBatches(rollupID uint32, batchNum uint64) (StateVariablesSequencedBatchData, error)
}
8 changes: 0 additions & 8 deletions sequencesender/sequencesender_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package sequencesender

import (
"context"
"testing"

"github.com/0xPolygon/cdk/log"
Expand Down Expand Up @@ -64,10 +63,3 @@ func TestStreamTx(t *testing.T) {

printBatch(decodedBatch, true, true)
}

func TestKK(t *testing.T) {
sut := &SequenceSender{}
sequences, err := sut.getSequencesToSend(context.TODO())
require.NoError(t, err)
require.NotNil(t, sequences)
}

0 comments on commit 3f2c709

Please sign in to comment.