Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename in cosmos lcd and rpc clients minGasPrices by simply gasPrices #1802

Merged
merged 1 commit into from
May 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions cosmos/lcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ import (

// LCD is a simple cosmos LCD client.
type LCD struct {
endpoint string
cdc *codec.Codec
kb keys.Keybase
chainID string
accName string
accPassword string
minGasPrices sdktypes.DecCoins
endpoint string
cdc *codec.Codec
kb keys.Keybase
chainID string
accName string
accPassword string
gasPrices sdktypes.DecCoins

// local state
acc *auth.BaseAccount
Expand All @@ -39,19 +39,19 @@ type LCD struct {
}

// NewLCD initializes a cosmos LCD client.
func NewLCD(endpoint string, cdc *codec.Codec, kb keys.Keybase, chainID, accName, accPassword, minGasPrices string) (*LCD, error) {
minGasPricesDecoded, err := sdktypes.ParseDecCoins(minGasPrices)
func NewLCD(endpoint string, cdc *codec.Codec, kb keys.Keybase, chainID, accName, accPassword, gasPrices string) (*LCD, error) {
gasPricesDecoded, err := sdktypes.ParseDecCoins(gasPrices)
if err != nil {
return nil, err
}
return &LCD{
endpoint: endpoint,
cdc: cdc,
kb: kb,
chainID: chainID,
accName: accName,
accPassword: accPassword,
minGasPrices: minGasPricesDecoded,
endpoint: endpoint,
cdc: cdc,
kb: kb,
chainID: chainID,
accName: accName,
accPassword: accPassword,
gasPrices: gasPricesDecoded,
}, nil
}

Expand Down Expand Up @@ -213,7 +213,7 @@ func (lcd *LCD) createAndSignTx(msgs []sdk.Msg, acc *auth.BaseAccount) (authtype
lcd.chainID,
"",
nil,
lcd.minGasPrices,
lcd.gasPrices,
).WithKeybase(lcd.kb)

// calculate gas
Expand Down
32 changes: 16 additions & 16 deletions cosmos/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ import (
// RPC is a tendermint rpc client with helper functions.
type RPC struct {
rpcclient.Client
cdc *codec.Codec
kb keys.Keybase
chainID string
accName string
accPassword string
minGasPrices sdktypes.DecCoins
cdc *codec.Codec
kb keys.Keybase
chainID string
accName string
accPassword string
gasPrices sdktypes.DecCoins

// Local state
acc authExported.Account
Expand All @@ -38,19 +38,19 @@ type RPC struct {
}

// NewRPC returns a rpc tendermint client.
func NewRPC(client rpcclient.Client, cdc *codec.Codec, kb keys.Keybase, chainID, accName, accPassword, minGasPrices string) (*RPC, error) {
minGasPricesDecoded, err := sdktypes.ParseDecCoins(minGasPrices)
func NewRPC(client rpcclient.Client, cdc *codec.Codec, kb keys.Keybase, chainID, accName, accPassword, gasPrices string) (*RPC, error) {
gasPricesDecoded, err := sdktypes.ParseDecCoins(gasPrices)
if err != nil {
return nil, err
}
return &RPC{
Client: client,
cdc: cdc,
kb: kb,
chainID: chainID,
accName: accName,
accPassword: accPassword,
minGasPrices: minGasPricesDecoded,
Client: client,
cdc: cdc,
kb: kb,
chainID: chainID,
accName: accName,
accPassword: accPassword,
gasPrices: gasPricesDecoded,
}, nil
}

Expand Down Expand Up @@ -213,7 +213,7 @@ func (c *RPC) createAndSignTx(msgs []sdktypes.Msg, acc authExported.Account) (te
c.chainID,
"",
nil,
c.minGasPrices,
c.gasPrices,
).WithKeybase(c.kb)

// calculate gas
Expand Down