cmd/evm: Added 'sender'-flag

This commit is contained in:
Martin Holst Swende 2017-06-07 10:48:00 +02:00
parent 21ac4dd109
commit 581dd37fa9
2 changed files with 8 additions and 0 deletions

View file

@ -98,6 +98,10 @@ var (
Name: "json",
Usage: "output trace logs in machine readable format (json)",
}
SenderFlag = cli.StringFlag{
Name: "sender",
Usage: "The transaction origin",
}
)
func init() {
@ -118,6 +122,7 @@ func init() {
StatDumpFlag,
GenesisFlag,
MachineFlag,
SenderFlag,
}
app.Commands = []cli.Command{
compileCommand,

View file

@ -97,6 +97,9 @@ func runCmd(ctx *cli.Context) error {
var db, _ = ethdb.NewMemDatabase()
statedb, _ = state.New(common.Hash{}, db)
}
if ctx.GlobalString(SenderFlag.Name) != "" {
sender = common.HexToAddress(ctx.GlobalString(SenderFlag.Name))
}
statedb.CreateAccount(sender)