(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestBalanceModuleAccountCheck(t *testing.T) { |
| 13 | tt := []struct { |
| 14 | name string |
| 15 | Pools []*types.Pool |
| 16 | moduleBalances sdk.Coins |
| 17 | stop bool |
| 18 | }{ |
| 19 | { |
| 20 | name: "ok without margin", |
| 21 | Pools: []*types.Pool{ |
| 22 | { |
| 23 | ExternalAsset: &types.Asset{Symbol: "ceth"}, |
| 24 | NativeAssetBalance: sdk.NewUint(1000), |
| 25 | ExternalAssetBalance: sdk.NewUint(2000), |
| 26 | ExternalCustody: sdk.ZeroUint(), |
| 27 | NativeCustody: sdk.ZeroUint(), |
| 28 | }, |
| 29 | }, |
| 30 | moduleBalances: sdk.NewCoins( |
| 31 | sdk.NewCoin("rowan", sdk.NewInt(1000)), |
| 32 | sdk.NewCoin("ceth", sdk.NewInt(2000)), |
| 33 | ), |
| 34 | stop: false, |
| 35 | }, |
| 36 | { |
| 37 | name: "ok with margin", |
| 38 | Pools: []*types.Pool{ |
| 39 | { |
| 40 | ExternalAsset: &types.Asset{Symbol: "ceth"}, |
| 41 | NativeAssetBalance: sdk.NewUint(1000), |
| 42 | ExternalAssetBalance: sdk.NewUint(2000), |
| 43 | ExternalCustody: sdk.NewUint(1000), |
| 44 | NativeCustody: sdk.NewUint(500), |
| 45 | }, |
| 46 | }, |
| 47 | moduleBalances: sdk.NewCoins( |
| 48 | sdk.NewCoin("rowan", sdk.NewInt(1500)), |
| 49 | sdk.NewCoin("ceth", sdk.NewInt(3000)), |
| 50 | ), |
| 51 | stop: false, |
| 52 | }, |
| 53 | { |
| 54 | name: "native balance not ok without margin", |
| 55 | Pools: []*types.Pool{ |
| 56 | { |
| 57 | ExternalAsset: &types.Asset{Symbol: "ceth"}, |
| 58 | NativeAssetBalance: sdk.NewUint(1000), |
| 59 | ExternalAssetBalance: sdk.NewUint(2000), |
| 60 | ExternalCustody: sdk.ZeroUint(), |
| 61 | NativeCustody: sdk.ZeroUint(), |
| 62 | }, |
| 63 | }, |
| 64 | moduleBalances: sdk.NewCoins( |
| 65 | sdk.NewCoin("rowan", sdk.NewInt(9000)), |
| 66 | sdk.NewCoin("ceth", sdk.NewInt(2000)), |
| 67 | ), |
| 68 | stop: true, |
| 69 | }, |
nothing calls this directly
no test coverage detected