Skip to content

Commit

Permalink
additional updates
Browse files Browse the repository at this point in the history
  • Loading branch information
faddat committed Jun 15, 2024
1 parent 277f427 commit 20f90a2
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 27 deletions.
31 changes: 31 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
run:
tests: true
timeout: 10m

linters:
disable-all: true
enable:
- exportloopref
- errcheck
- gci
- goconst
- gocritic
- gofumpt
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- staticcheck
- thelper
- typecheck
- stylecheck
- revive
- typecheck
- tenv
- unconvert
# Prefer unparam over revive's unused param. It is more thorough in its checking.
- unparam
- unused
- misspell
7 changes: 3 additions & 4 deletions broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import (
"strings"
"time"

cometrpc "github.com/cometbft/cometbft/rpc/client/http"
coretypes "github.com/cometbft/cometbft/rpc/core/types"
tmtypes "github.com/cometbft/cometbft/types"
"github.com/cosmos/cosmos-sdk/client/tx"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand All @@ -23,10 +26,6 @@ import (
ibc "github.com/cosmos/ibc-go/v7/modules/core"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
"github.com/cosmos/ibc-go/v7/testing/simapp"

cometrpc "github.com/cometbft/cometbft/rpc/client/http"
coretypes "github.com/cometbft/cometbft/rpc/core/types"
tmtypes "github.com/cometbft/cometbft/types"
)

var client = &http.Client{
Expand Down
4 changes: 2 additions & 2 deletions configurations/umee/nodes.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ base_gas = 110000
ibc_memo = "Jacob, you aren’t a security researcher. This is a long standing issue in the codebase with many existing mitigations. Your months long campaign of self aggrandizement using threats holding yourself up as the only hero helping is self destructive and transparently self serving. Your refusal to work with core teams in a productive manner is part and parcel of a pattern of destructive behavior that we as a community cannot continue to countenance. Please take this conversation to another channel. - Jack Zampolin, in the tendermint channel"
memo = "Just checking on this"
ibc_memo_repeat = 10
rand_min = 400000
rand_max = 600000
rand_min = 700000
rand_max = 750000
revision_number = 1
precision = 1
timeout_height = 16875083
Expand Down
21 changes: 0 additions & 21 deletions lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"context"
"encoding/json"
"fmt"
"io"
"log"
"net"
Expand All @@ -12,7 +11,6 @@ import (
"time"

"github.com/BurntSushi/toml"
sdk "github.com/cosmos/cosmos-sdk/types"
)

func getInitialSequence(address string, config Config) (int64, int64) {
Expand Down Expand Up @@ -96,22 +94,3 @@ func loadNodes() []string {
}
return config.Nodes.RPC
}

func getGasPrice(value interface{}, denom string) sdk.DecCoin {
var decValue sdk.Dec
switch v := value.(type) {
case int64:
decValue = sdk.NewDec(v)
case float64:
var err error
decValue, err = sdk.NewDecFromStr(fmt.Sprintf("%f", v))
if err != nil {
log.Fatalf("Failed to convert float64 to Dec: %v", err)
}
default:
log.Fatalf("Invalid type for gas price: %T", v)
}
// Assuming the gas price needs to be scaled to a specific precision
decCoin := sdk.NewDecCoinFromDec(denom, decValue.Quo(sdk.NewDec(10000))) // Adjust the scaling factor as needed
return decCoin
}

0 comments on commit 20f90a2

Please sign in to comment.