File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
rollup/internal/controller/relayer Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -524,23 +524,17 @@ func (r *Layer2Relayer) ProcessPendingBatches() {
524524}
525525
526526func (r * Layer2Relayer ) contextIDFromBatches (codecVersion encoding.CodecVersion , batches []* dbBatchWithChunksAndParent ) string {
527- var prefix string
528- if codecVersion == encoding .CodecV7 {
529- prefix = "v7"
530- } else {
531- prefix = "v8"
532- }
533-
534- contextIDs := []string {prefix }
527+ contextIDs := []string {fmt .Sprintf ("v%d" , codecVersion )}
535528 for _ , batch := range batches {
536529 contextIDs = append (contextIDs , batch .Batch .Hash )
537530 }
538531 return strings .Join (contextIDs , "-" )
539532}
540533
541534func (r * Layer2Relayer ) batchHashesFromContextID (contextID string ) []string {
542- if strings .HasPrefix (contextID , "v7-" ) || strings .HasPrefix (contextID , "v8-" ) {
543- return strings .Split (contextID , "-" )[1 :]
535+ parts := strings .SplitN (contextID , "-" , 2 )
536+ if len (parts ) == 2 && strings .HasPrefix (parts [0 ], "v" ) {
537+ return strings .Split (parts [1 ], "-" )
544538 }
545539 return []string {contextID }
546540}
You can’t perform that action at this time.
0 commit comments