node: strip leading 0x for send-observation-request

This allows copying and pasting transactions from montioring tools or
an explorer to be reobserved.
This commit is contained in:
Jeff Schroeder 2023-01-20 16:55:37 +00:00 committed by Evan Gray
parent 45b3d18d80
commit cd93c57d66
1 changed files with 3 additions and 1 deletions

View File

@ -345,7 +345,9 @@ func runSendObservationRequest(cmd *cobra.Command, args []string) {
log.Fatalf("invalid chain ID: %v", err)
}
txHash, err := hex.DecodeString(args[1])
// Support tx with or without leading 0x so copy / pasta
// from monitoring tools is easier.
txHash, err := hex.DecodeString(strings.TrimPrefix(args[1], "0x"))
if err != nil {
txHash, err = base58.Decode(args[1])
if err != nil {