(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func TestAPI(t *testing.T) { |
| 12 | // begin block use case, we have a dozen modules, but only care about a couple orders. |
| 13 | // In practice this will be gotten from some API, e.g. app.AllModuleNames() |
| 14 | moduleNames := []string{ |
| 15 | "auth", "authz", "bank", "capabilities", |
| 16 | "staking", "distribution", "epochs", "mint", "upgrades", "wasm", "ibc", |
| 17 | "ibctransfers", |
| 18 | } |
| 19 | beginBlockOrd := partialord.NewPartialOrdering(moduleNames) |
| 20 | beginBlockOrd.FirstElements("upgrades", "epochs", "capabilities") |
| 21 | beginBlockOrd.After("ibctransfers", "ibc") |
| 22 | beginBlockOrd.Before("mint", "distribution") |
| 23 | // This is purely just to test last functionality, doesn't make sense in context |
| 24 | beginBlockOrd.LastElements("auth", "authz", "wasm") |
| 25 | |
| 26 | totalOrd := beginBlockOrd.TotalOrdering() |
| 27 | expTotalOrd := []string{ |
| 28 | "upgrades", "epochs", "capabilities", |
| 29 | "bank", "ibc", "mint", "staking", "ibctransfers", "distribution", |
| 30 | "auth", "authz", "wasm", |
| 31 | } |
| 32 | require.Equal(t, expTotalOrd, totalOrd) |
| 33 | } |
| 34 | |
| 35 | func TestNonStandardAPIOrder(t *testing.T) { |
| 36 | // This test uses direct ordering before First, and after Last |
nothing calls this directly
no test coverage detected