From 286f40b828eb7d24b6336124107340756750750e Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Sun, 20 Nov 2022 16:02:24 +0300 Subject: [PATCH] cli/vm: use tx system fee by default --- cli/vm/cli.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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