@@ -35,14 +35,15 @@ import (
3535)
3636
3737type Flags struct {
38- ArgsJSON string `default:"" flag:"args-json" info:"arguments in JSON-Cadence format"`
39- Signer string `default:"" flag:"signer" info:"Account name from configuration used to sign the transaction as proposer, payer and suthorizer"`
40- Proposer string `default:"" flag:"proposer" info:"Account name from configuration used as proposer"`
41- Payer string `default:"" flag:"payer" info:"Account name from configuration used as payer"`
42- Authorizers []string `default:"" flag:"authorizer" info:"Name of a single or multiple comma-separated accounts used as authorizers from configuration"`
43- Include []string `default:"" flag:"include" info:"Fields to include in the output"`
44- Exclude []string `default:"" flag:"exclude" info:"Fields to exclude from the output (events)"`
45- GasLimit uint64 `default:"1000" flag:"gas-limit" info:"transaction gas limit"`
38+ ArgsJSON string `default:"" flag:"args-json" info:"arguments in JSON-Cadence format"`
39+ Signer string `default:"" flag:"signer" info:"Account name from configuration used to sign the transaction as proposer, payer and suthorizer"`
40+ Proposer string `default:"" flag:"proposer" info:"Account name from configuration used as proposer"`
41+ Payer string `default:"" flag:"payer" info:"Account name from configuration used as payer"`
42+ Authorizers []string `default:"" flag:"authorizer" info:"Name of a single or multiple comma-separated accounts used as authorizers from configuration"`
43+ Include []string `default:"" flag:"include" info:"Fields to include in the output"`
44+ Exclude []string `default:"" flag:"exclude" info:"Fields to exclude from the output (events)"`
45+ ComputeLimit uint64 `default:"1000" flag:"compute-limit" info:"transaction compute limit"`
46+ GasLimit uint64 `default:"" flag:"gas-limit" info:"(deprecated: use compute-limit) transaction gas limit"`
4647}
4748
4849var flags = Flags {}
@@ -61,7 +62,7 @@ var sendCommand = &command.Command{
6162func send (
6263 args []string ,
6364 _ command.GlobalFlags ,
64- _ output.Logger ,
65+ logger output.Logger ,
6566 flow flowkit.Services ,
6667 state * flowkit.State ,
6768) (result command.Result , err error ) {
@@ -72,10 +73,10 @@ func send(
7273 return nil , fmt .Errorf ("error loading transaction file: %w" , err )
7374 }
7475
75- return SendTransaction (code , args , filename , flow , state , flags )
76+ return SendTransaction (code , args , filename , flow , state , flags , logger )
7677}
7778
78- func SendTransaction (code []byte , args []string , location string , flow flowkit.Services , state * flowkit.State , sendFlags Flags ) (result command.Result , err error ) {
79+ func SendTransaction (code []byte , args []string , location string , flow flowkit.Services , state * flowkit.State , sendFlags Flags , logger output. Logger ) (result command.Result , err error ) {
7980 proposerName := sendFlags .Proposer
8081 var proposer * accounts.Account
8182 if proposerName != "" {
@@ -138,6 +139,13 @@ func SendTransaction(code []byte, args []string, location string, flow flowkit.S
138139 return nil , fmt .Errorf ("error parsing transaction arguments: %w" , err )
139140 }
140141
142+ // Use GasLimit if set (for backwards compatibility), otherwise use ComputeLimit
143+ computeLimit := sendFlags .ComputeLimit
144+ if sendFlags .GasLimit > 0 {
145+ logger .Info ("⚠️ Warning: --gas-limit flag is deprecated, please use --compute-limit instead" )
146+ computeLimit = sendFlags .GasLimit
147+ }
148+
141149 tx , txResult , err := flow .SendTransaction (
142150 context .Background (),
143151 transactions.AccountRoles {
@@ -146,7 +154,7 @@ func SendTransaction(code []byte, args []string, location string, flow flowkit.S
146154 Payer : * payer ,
147155 },
148156 flowkit.Script {Code : code , Args : transactionArgs , Location : location },
149- sendFlags . GasLimit ,
157+ computeLimit ,
150158 )
151159 if err != nil {
152160 return nil , err
0 commit comments