diff --git a/etherman/contracts/interfaces.go b/etherman/contracts/interfaces.go index 87061874..e5bfe39c 100644 --- a/etherman/contracts/interfaces.go +++ b/etherman/contracts/interfaces.go @@ -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 @@ -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) -} diff --git a/sequencesender/sequencesender_test.go b/sequencesender/sequencesender_test.go index 6df35b30..ca0d33e7 100644 --- a/sequencesender/sequencesender_test.go +++ b/sequencesender/sequencesender_test.go @@ -1,7 +1,6 @@ package sequencesender import ( - "context" "testing" "github.com/0xPolygon/cdk/log" @@ -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) -}