Skip to content

Commit

Permalink
Merge pull request #374 from onflow/bugfix/gas-limit
Browse files Browse the repository at this point in the history
Add Gas Limit Default
  • Loading branch information
sideninja authored Aug 30, 2021
2 parents c9efe43 + a1f3bb3 commit 695f303
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pkg/flowkit/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import (
"github.com/onflow/flow-go-sdk"
)

const maxGasLimit uint64 = 9999

// NewTransaction create new instance of transaction.
func NewTransaction() *Transaction {
return &Transaction{
Expand Down Expand Up @@ -124,6 +126,7 @@ func addAccountContractWithArgs(

script := fmt.Sprintf(addAccountContractTemplate, txArgs, addArgs)
tx.SetScript([]byte(script))
tx.SetGasLimit(maxGasLimit)

t := &Transaction{tx: tx}
err := t.SetSigner(signer)
Expand Down Expand Up @@ -156,6 +159,7 @@ func newTransactionFromTemplate(templateTx *flow.Transaction, signer *Account) (
return nil, err
}
tx.SetPayer(signer.Address())
tx.SetGasLimit(maxGasLimit) // todo change this to calculated limit

return tx, nil
}
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.28.1
v0.28.2

0 comments on commit 695f303

Please sign in to comment.