(lastBlobIndex uint64, metafile string)
| 82 | } |
| 83 | |
| 84 | func NewMockL1Source(lastBlobIndex uint64, metafile string) *mockL1Source { |
| 85 | if len(metafile) == 0 { |
| 86 | panic("metafile param is needed when using mock l1") |
| 87 | } |
| 88 | |
| 89 | file, err := os.OpenFile(metafile, os.O_RDONLY, 0600) |
| 90 | if err != nil { |
| 91 | panic(fmt.Sprintf("open metafile fail with err %s", err.Error())) |
| 92 | } |
| 93 | return &mockL1Source{lastBlobIndex: lastBlobIndex, metaFile: file} |
| 94 | } |
| 95 | |
| 96 | func (l1 *mockL1Source) getMetadata(idx uint64) ([32]byte, error) { |
| 97 | bs := make([]byte, 32) |
no test coverage detected