(ctx *cli.Context)
| 169 | } |
| 170 | |
| 171 | func showTx(ctx *cli.Context) error { |
| 172 | SetRpcPort(ctx) |
| 173 | if ctx.NArg() < 1 { |
| 174 | PrintErrorMsg("Missing raw tx argument.") |
| 175 | cli.ShowSubcommandHelp(ctx) |
| 176 | return nil |
| 177 | } |
| 178 | rawTx := ctx.Args().First() |
| 179 | txData, err := hex.DecodeString(rawTx) |
| 180 | if err != nil { |
| 181 | return fmt.Errorf("RawTx hex decode error:%s", err) |
| 182 | } |
| 183 | tx, err := types.TransactionFromRawBytes(txData) |
| 184 | if err != nil { |
| 185 | return fmt.Errorf("TransactionFromRawBytes error:%s", err) |
| 186 | } |
| 187 | txInfo := httpcom.TransArryByteToHexString(tx) |
| 188 | |
| 189 | txHash := tx.Hash() |
| 190 | height, _ := utils.GetTxHeight(txHash.ToHexString()) |
| 191 | txInfo.Height = height |
| 192 | PrintJsonObject(txInfo) |
| 193 | return nil |
| 194 | } |
nothing calls this directly
no test coverage detected