Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #39 from JackalLabs/out-of-gas-fix
Browse files Browse the repository at this point in the history
Out of gas fix
  • Loading branch information
TheMarstonConnell authored Mar 22, 2023
2 parents 854b184 + bede67d commit f446600
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/cosmos/cosmos-sdk v0.45.11
github.com/cosmos/go-bip39 v1.0.0
github.com/huin/goupnp v1.0.3
github.com/jackalLabs/canine-chain v1.2.0-beta.6
github.com/jackalLabs/canine-chain v1.2.0-beta.7
github.com/julienschmidt/httprouter v1.3.0
github.com/rs/cors v1.8.2
github.com/rs/zerolog v1.27.0
Expand Down
2 changes: 1 addition & 1 deletion jprov/jprovd/provider_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,5 @@ func AddTxFlagsToCmd(cmd *cobra.Command) {
cmd.Flags().String(flags.FlagChainID, "", "The network chain ID")

// --gas can accept integers and "auto"
cmd.Flags().String(flags.FlagGas, "", fmt.Sprintf("gas limit to set per-transaction; set to %q to calculate sufficient gas automatically (default %d)", flags.GasFlagAuto, flags.DefaultGasLimit))
cmd.Flags().String(flags.FlagGas, "auto", fmt.Sprintf("gas limit to set per-transaction; set to %q to calculate sufficient gas automatically (default %d)", flags.GasFlagAuto, flags.DefaultGasLimit))
}
1 change: 1 addition & 0 deletions jprov/queue/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/JackalLabs/jackal-provider/jprov/types"
"github.com/JackalLabs/jackal-provider/jprov/utils"

"github.com/cosmos/cosmos-sdk/client"
ctypes "github.com/cosmos/cosmos-sdk/types"
"github.com/spf13/cobra"
Expand Down
2 changes: 2 additions & 0 deletions jprov/server/proofs.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/JackalLabs/jackal-provider/jprov/queue"
"github.com/JackalLabs/jackal-provider/jprov/types"
"github.com/JackalLabs/jackal-provider/jprov/utils"

"github.com/wealdtech/go-merkletree/sha3"

sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -128,6 +129,7 @@ func postProof(clientCtx client.Context, cid string, block string, db *leveldb.D
wg.Wait()

if u.Err != nil {

ctx.Logger.Error(fmt.Sprintf("Posting Error: %s", u.Err.Error()))
return
}
Expand Down
15 changes: 15 additions & 0 deletions jprov/testutils/logger.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package testutils

import (
"fmt"
"log"
"os"
)

func CreateLogger(filename string) (log.Logger, *os.File) {
f, _ := os.OpenFile(fmt.Sprintf("%s.log", filename), os.O_RDWR|os.O_CREATE|os.O_APPEND, 0o666)
log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
log.SetOutput(f)

return *log.Default(), f
}
2 changes: 2 additions & 0 deletions jprov/utils/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"

"github.com/JackalLabs/jackal-provider/jprov/crypto"

"github.com/cosmos/cosmos-sdk/client"
txns "github.com/cosmos/cosmos-sdk/client/tx"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -70,6 +71,7 @@ func SendTx(clientCtx client.Context, flagSet *pflag.FlagSet, msgs ...sdk.Msg) (
txf = txf.WithGas(adjusted)
_, _ = fmt.Fprintf(os.Stderr, "%s\n", txns.GasEstimateResponse{GasEstimate: txf.Gas()})
}

if clientCtx.Simulate {
return nil, nil
}
Expand Down

0 comments on commit f446600

Please sign in to comment.