Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
cmd/evm: remove surrounding whitespace in hex input code (ethereum#20211
Browse files Browse the repository at this point in the history
)

This way, the output of `evm compile` can be used directly in `evm
--codefile code.txt run`, without stripping the trailing newline first.
  • Loading branch information
michaelforney authored and elizabethengelman committed Dec 20, 2019
1 parent f52b6a2 commit c8a13c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/evm/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package main

import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
Expand Down Expand Up @@ -145,6 +146,7 @@ func runCmd(ctx *cli.Context) error {
} else {
hexcode = []byte(codeFlag)
}
hexcode = bytes.TrimSpace(hexcode)
if len(hexcode)%2 != 0 {
fmt.Printf("Invalid input length for hex data (%d)\n", len(hexcode))
os.Exit(1)
Expand Down

0 comments on commit c8a13c8

Please sign in to comment.