diff --git a/cli/vm/cli.go b/cli/vm/cli.go index b0e8be324..36b021ab7 100644 --- a/cli/vm/cli.go +++ b/cli/vm/cli.go @@ -205,7 +205,10 @@ Example: UsageText: `loadtx [--historic ] [--gas ] `, Flags: []cli.Flag{historicFlag, gasFlag}, Description: `Load transaction into the VM from chain or from parameter context file. -The transaction script will be loaded into VM; the resulting execution context will use the provided transaction as script container including its signers, hash and nonce. + The transaction script will be loaded into VM; the resulting execution context + will use the provided transaction as script container including its signers, + hash and nonce. It'll also use transaction's system fee value as GAS limit if + --gas option is not used. is mandatory parameter. @@ -829,6 +832,9 @@ func handleLoadTx(c *cli.Context) error { return err } v := getVMFromContext(c.App) + if v.GasLimit == -1 { + v.GasLimit = tx.SystemFee + } fmt.Fprintf(c.App.Writer, "READY: loaded %d instructions\n", v.Context().LenInstr()) changePrompt(c.App) return nil