(clientCtx client.Context, txf tx.Factory, key keyring.Info)
| 236 | } |
| 237 | |
| 238 | func TestOpenPosition(clientCtx client.Context, txf tx.Factory, key keyring.Info) error { |
| 239 | msg := types.MsgOpen{ |
| 240 | Signer: key.GetAddress().String(), |
| 241 | CollateralAsset: "rowan", |
| 242 | CollateralAmount: sdk.NewUint(100), |
| 243 | BorrowAsset: "ceth", |
| 244 | Position: types.Position_LONG, |
| 245 | Leverage: sdk.NewDec(2), |
| 246 | } |
| 247 | |
| 248 | res, err := buildAndBroadcast(clientCtx, txf, key, &msg) |
| 249 | if err != nil { |
| 250 | panic(err) |
| 251 | } |
| 252 | |
| 253 | log.Print(res) |
| 254 | |
| 255 | return err |
| 256 | } |
| 257 | |
| 258 | func buildAndBroadcast(clientCtx client.Context, txf tx.Factory, key keyring.Info, msg sdk.Msg) (*sdk.TxResponse, error) { |
| 259 | txb, err := tx.BuildUnsignedTx(txf, msg) |
no test coverage detected