(l1api miner.L1API, contract common.Address, chainHeadCh chan eth.L1BlockRef, shardIdx uint64, exitCh chan uint64)
| 167 | } |
| 168 | |
| 169 | func waitForMined(l1api miner.L1API, contract common.Address, chainHeadCh chan eth.L1BlockRef, shardIdx uint64, exitCh chan uint64) { |
| 170 | for range chainHeadCh { |
| 171 | info, err := l1api.GetMiningInfo( |
| 172 | context.Background(), |
| 173 | contract, |
| 174 | shardIdx, |
| 175 | ) |
| 176 | if err != nil { |
| 177 | lg.Warn("Failed to get es mining info", "error", err.Error()) |
| 178 | continue |
| 179 | } |
| 180 | lg.Info("Starting shard mining", "shard", shardIdx, "lastMined", info.BlockMined, "blockNumber", info.LastMineTime) |
| 181 | if info.BlockMined.Uint64() > 0 { |
| 182 | lg.Info("Mined new", "shard", shardIdx, "justMined", info.BlockMined) |
| 183 | exitCh <- shardIdx |
| 184 | return |
| 185 | } |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | func initStorageConfig(t *testing.T, client *eth.PollingClient, l1Contract, miner common.Address) *storage.StorageConfig { |
| 190 | result, err := client.ReadContractField("maxKvSizeBits", nil) |
no test coverage detected