Skip to content

Commit

Permalink
parameterize rollup id
Browse files Browse the repository at this point in the history
  • Loading branch information
bharath-123 committed Jul 31, 2024
1 parent 2513e50 commit 641e42f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type ScenarioOptions struct {
MaxWallets uint64
ComposerAddress string
NoOfBytes uint64
RollupId string
}

type Scenario struct {
Expand All @@ -46,6 +47,7 @@ func (s *Scenario) Flags(flags *pflag.FlagSet) error {
flags.Uint64Var(&s.options.MaxWallets, "max-wallets", 0, "Maximum number of child wallets to use")
flags.StringVar(&s.options.ComposerAddress, "composer-address", "localhost:50051", "Address of the composer service")
flags.Uint64Var(&s.options.NoOfBytes, "no-of-bytes", 0, "Number of bytes to send in the sequence action")
flags.StringVar(&s.options.RollupId, "rollup-id", "", "Rollup ID to send the sequence action to")

return nil
}
Expand Down Expand Up @@ -146,18 +148,18 @@ func (s *Scenario) Run() error {

func (s *Scenario) sendTx() error {

err := SendSequencerTransferViaComposer(s.composerConn, s.options.NoOfBytes)
err := SendSequencerTransferViaComposer(s.composerConn, s.options.NoOfBytes, s.options.RollupId)
if err != nil {
return err
}

return nil
}

func SendSequencerTransferViaComposer(conn *grpc.ClientConn, noOfBytes uint64) error {
func SendSequencerTransferViaComposer(conn *grpc.ClientConn, noOfBytes uint64, rollupId string) error {
grpcCollectorServiceClient := grpc_receiver.NewSequencerGrpcCollectorServiceClient(conn)

hashedRollupId := sha256.Sum256([]byte("random-rollup-id"))
hashedRollupId := sha256.Sum256([]byte(rollupId))

// create a random array of bytes of size noOfBytes
data := make([]byte, noOfBytes)
Expand Down
2 changes: 1 addition & 1 deletion tester/tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (tester *Tester) Start(seed string) error {
}).Infof("starting blob testing tool")

fmt.Printf("Tester scenario is %s\n", tester.config.Scenario)
if tester.config.Scenario != "sequencertransfertx" {
if tester.config.Scenario != "sequencertransfertx" && tester.config.Scenario != "sequencersequenceactiontx" {
// prepare clients
err = tester.PrepareClients()
if err != nil {
Expand Down

0 comments on commit 641e42f

Please sign in to comment.