| 259 | + | c.Assert(mgr.K.SetPool(ctx, pool), IsNil) |
| 260 | + | } |
| 261 | + | volume := types.NewVolume(common.BTCAsset) |
| 262 | + | volume.ChangeRune = cosmos.NewUint(123) |
| 263 | + | c.Assert(mgr.K.SetVolume(ctx, volume), IsNil) |
| 264 | + | |
| 265 | + | var logs bytes.Buffer |
| 266 | + | logger := zerolog.New(&logs) |
| 267 | + | ctx = ctx.WithLogger(thorlog.SdkLogWrapper{Logger: &logger}) |
| 268 | + | c.Assert(mgr.volumeManager.EndBlock(ctx), IsNil) |
| 269 | + | c.Check(logs.String(), Not(Matches), "(?s).*fail to get volume.*") |
| 270 | + | |
| 271 | + | // the pool with a volume still rolls over; the other still has none |
| 272 | + | volume, err := mgr.K.GetVolume(ctx, common.BTCAsset) |
| 273 | + | c.Assert(err, IsNil) |
| 274 | + | c.Check(volume.ChangeRune.IsZero(), Equals, true) |
| 275 | + | c.Check(volume.TotalRune.Uint64(), Equals, uint64(123)) |
| 276 | + | _, err = mgr.K.GetVolume(ctx, common.ETHAsset) |
| 277 | + | c.Check(err, NotNil) |
| 278 | + | iterator := mgr.K.GetVolumeBucketIterator(ctx, common.ETHAsset) |
| 279 | + | c.Check(iterator.Valid(), Equals, false) |
| 280 | + | c.Assert(iterator.Close(), IsNil) |
| 281 | + | } |