(t *testing.T)
| 212 | } |
| 213 | |
| 214 | func TestKeeper_Close(t *testing.T) { |
| 215 | table := []struct { |
| 216 | msgOpen types.MsgOpen |
| 217 | msgClose types.MsgClose |
| 218 | name string |
| 219 | poolAsset string |
| 220 | token string |
| 221 | overrideSigner string |
| 222 | err error |
| 223 | errString error |
| 224 | poolEnabled bool |
| 225 | fundedAccount bool |
| 226 | mtpCreateDisabled bool |
| 227 | }{ |
| 228 | { |
| 229 | name: "mtp does not exist", |
| 230 | msgClose: types.MsgClose{ |
| 231 | Signer: "xxx", |
| 232 | }, |
| 233 | msgOpen: types.MsgOpen{ |
| 234 | CollateralAsset: "xxx", |
| 235 | BorrowAsset: "xxx", |
| 236 | Position: types.Position_LONG, |
| 237 | }, |
| 238 | poolAsset: "rowan", |
| 239 | token: "somethingelse", |
| 240 | overrideSigner: "otheraddress", |
| 241 | errString: types.ErrMTPDoesNotExist, |
| 242 | }, |
| 243 | { |
| 244 | name: "pool does not exist", |
| 245 | msgClose: types.MsgClose{ |
| 246 | Signer: "xxx", |
| 247 | Id: 1, |
| 248 | }, |
| 249 | msgOpen: types.MsgOpen{ |
| 250 | CollateralAsset: "xxx", |
| 251 | BorrowAsset: "xxx", |
| 252 | Position: types.Position_LONG, |
| 253 | }, |
| 254 | poolAsset: "rowan", |
| 255 | token: "somethingelse", |
| 256 | errString: sdkerrors.Wrap(clptypes.ErrPoolDoesNotExist, "xxx"), |
| 257 | }, |
| 258 | { |
| 259 | name: "same collateral and native asset but pool does not exist", |
| 260 | msgClose: types.MsgClose{ |
| 261 | Signer: "xxx", |
| 262 | Id: 1, |
| 263 | }, |
| 264 | msgOpen: types.MsgOpen{ |
| 265 | CollateralAsset: "rowan", |
| 266 | BorrowAsset: "xxx", |
| 267 | Position: types.Position_LONG, |
| 268 | }, |
| 269 | poolAsset: "rowan", |
| 270 | token: "somethingelse", |
| 271 | errString: sdkerrors.Wrap(clptypes.ErrPoolDoesNotExist, "xxx"), |
nothing calls this directly
no test coverage detected