Skip to content

Commit 1469e85

Browse files
committed
Add deprecation message
1 parent ab5bbd0 commit 1469e85

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

internal/super/flix.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ func executeFlixCmd(
154154
computeLimit := flags.ComputeLimit
155155
gasLimit := uint64(0)
156156
if flags.GasLimit > 0 {
157+
logger.Info("⚠️ Warning: --gas-limit flag is deprecated, please use --compute-limit instead")
157158
computeLimit = flags.GasLimit
158159
gasLimit = flags.GasLimit
159160
}
@@ -170,7 +171,7 @@ func executeFlixCmd(
170171
GasLimit: gasLimit,
171172
}
172173
// some reason sendTransaction clips the first argument
173-
return transactions.SendTransaction([]byte(cadenceWithImportsReplaced.Cadence), args, "", flow, state, transactionFlags)
174+
return transactions.SendTransaction([]byte(cadenceWithImportsReplaced.Cadence), args, "", flow, state, transactionFlags, logger)
174175
}
175176

176177
func packageCmd(

internal/transactions/build.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ var buildCommand = &command.Command{
6262
func build(
6363
args []string,
6464
globalFlags command.GlobalFlags,
65-
_ output.Logger,
65+
logger output.Logger,
6666
flow flowkit.Services,
6767
state *flowkit.State,
6868
) (command.Result, error) {
@@ -105,6 +105,7 @@ func build(
105105
// Use GasLimit if set (for backwards compatibility), otherwise use ComputeLimit
106106
computeLimit := buildFlags.ComputeLimit
107107
if buildFlags.GasLimit > 0 {
108+
logger.Info("⚠️ Warning: --gas-limit flag is deprecated, please use --compute-limit instead")
108109
computeLimit = buildFlags.GasLimit
109110
}
110111

internal/transactions/send.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ var sendCommand = &command.Command{
6262
func send(
6363
args []string,
6464
_ command.GlobalFlags,
65-
_ output.Logger,
65+
logger output.Logger,
6666
flow flowkit.Services,
6767
state *flowkit.State,
6868
) (result command.Result, err error) {
@@ -73,10 +73,10 @@ func send(
7373
return nil, fmt.Errorf("error loading transaction file: %w", err)
7474
}
7575

76-
return SendTransaction(code, args, filename, flow, state, flags)
76+
return SendTransaction(code, args, filename, flow, state, flags, logger)
7777
}
7878

79-
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) {
8080
proposerName := sendFlags.Proposer
8181
var proposer *accounts.Account
8282
if proposerName != "" {
@@ -142,6 +142,7 @@ func SendTransaction(code []byte, args []string, location string, flow flowkit.S
142142
// Use GasLimit if set (for backwards compatibility), otherwise use ComputeLimit
143143
computeLimit := sendFlags.ComputeLimit
144144
if sendFlags.GasLimit > 0 {
145+
logger.Info("⚠️ Warning: --gas-limit flag is deprecated, please use --compute-limit instead")
145146
computeLimit = sendFlags.GasLimit
146147
}
147148

0 commit comments

Comments
 (0)