Skip to content

Commit

Permalink
fix test and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gupadhyaya committed Oct 1, 2024
1 parent 79a6630 commit 67ff8ae
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion sequencing.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,28 @@ type Sequencer interface {
// SequencerInput provides a method for submitting a transaction from rollup to sequencer
type SequencerInput interface {
// SubmitRollupTransaction submits a transaction from rollup to sequencer
// RollupId is the unique identifier for the rollup chain
// Tx is the transaction to submit
// returns an error if any from the sequencer
SubmitRollupTransaction(ctx context.Context, req SubmitRollupTransactionRequest) (*SubmitRollupTransactionResponse, error)
}

// SequencerOutput provides a method for getting the next batch of transactions from sequencer to rollup
type SequencerOutput interface {
// GetNextBatch returns the next batch of transactions from sequencer to rollup
// lastBatch is the last batch of transactions received from the sequencer
// RollupId is the unique identifier for the rollup chain
// LastBatchHash is the cryptographic hash of the last batch received by the rollup
// MaxBytes is the maximum number of bytes to return in the batch
// returns the next batch of transactions and an error if any from the sequencer
GetNextBatch(ctx context.Context, req GetNextBatchRequest) (*GetNextBatchResponse, error)
}

// BatchVerifier provides a method for verifying a batch of transactions received from the sequencer
type BatchVerifier interface {
// VerifyBatch verifies a batch of transactions received from the sequencer
// RollupId is the unique identifier for the rollup chain
// BatchHash is the cryptographic hash of the batch to verify
// returns a boolean indicating if the batch is valid and an error if any from the sequencer
VerifyBatch(ctx context.Context, req VerifyBatchRequest) (*VerifyBatchResponse, error)
}

Expand Down
2 changes: 1 addition & 1 deletion test/dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (d *DummySequencer) SubmitRollupTransaction(ctx context.Context, req sequen
}
}
d.tq.AddTransaction(req.Tx)
return nil, nil
return &sequencing.SubmitRollupTransactionResponse{}, nil
}

// GetNextBatch implements sequencing.Sequencer.
Expand Down
2 changes: 1 addition & 1 deletion test/dummy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestSubmitRollupTransaction(t *testing.T) {
// Assert no error
assert.NoError(t, err)
// Assert the transaction was successfully added to the queue
assert.Nil(t, resp)
assert.NotNil(t, resp)
assert.Equal(t, rollupId, sequencer.RollupId)
}

Expand Down

0 comments on commit 67ff8ae

Please sign in to comment.