diff --git a/go.mod b/go.mod index 59073b6..485e7b5 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/jprov/jprovd/provider_commands.go b/jprov/jprovd/provider_commands.go index 5a714cc..d040e1b 100644 --- a/jprov/jprovd/provider_commands.go +++ b/jprov/jprovd/provider_commands.go @@ -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)) } diff --git a/jprov/queue/queue.go b/jprov/queue/queue.go index 2e7a186..b3da71e 100644 --- a/jprov/queue/queue.go +++ b/jprov/queue/queue.go @@ -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" diff --git a/jprov/server/proofs.go b/jprov/server/proofs.go index 75a4bf6..d2ad878 100644 --- a/jprov/server/proofs.go +++ b/jprov/server/proofs.go @@ -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" @@ -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 } diff --git a/jprov/testutils/logger.go b/jprov/testutils/logger.go new file mode 100644 index 0000000..96f71f5 --- /dev/null +++ b/jprov/testutils/logger.go @@ -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 +} diff --git a/jprov/utils/tx.go b/jprov/utils/tx.go index 6a3ca0d..7e6476c 100644 --- a/jprov/utils/tx.go +++ b/jprov/utils/tx.go @@ -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" @@ -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 }