Skip to content

Commit

Permalink
remove fee grant leftovers
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazar955 committed Jan 21, 2025
1 parent 0ba6efc commit 561f681
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 44 deletions.
3 changes: 1 addition & 2 deletions client/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ func New(cfg *config.BabylonConfig, logger *zap.Logger) (*Client, error) {
// NOTE: this will create a RPC client. The RPC client will be used for
// submitting txs and making ad hoc queries. It won't create WebSocket
// connection with Babylon node
err = cp.Init()
if err != nil {
if err = cp.Init(); err != nil {
return nil, err
}

Expand Down
59 changes: 17 additions & 42 deletions client/relayer/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"github.com/cometbft/cometbft/rpc/client/http"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"io"
"os"
"path"
Expand All @@ -14,47 +13,23 @@ import (
)

type CosmosProviderConfig struct {
KeyDirectory string `json:"key-directory" yaml:"key-directory"`
Key string `json:"key" yaml:"key"`
ChainName string `json:"-" yaml:"-"`
ChainID string `json:"chain-id" yaml:"chain-id"`
RPCAddr string `json:"rpc-addr" yaml:"rpc-addr"`
AccountPrefix string `json:"account-prefix" yaml:"account-prefix"`
KeyringBackend string `json:"keyring-backend" yaml:"keyring-backend"`
GasAdjustment float64 `json:"gas-adjustment" yaml:"gas-adjustment"`
GasPrices string `json:"gas-prices" yaml:"gas-prices"`
MinGasAmount uint64 `json:"min-gas-amount" yaml:"min-gas-amount"`
MaxGasAmount uint64 `json:"max-gas-amount" yaml:"max-gas-amount"`
Debug bool `json:"debug" yaml:"debug"`
Timeout string `json:"timeout" yaml:"timeout"`
BlockTimeout string `json:"block-timeout" yaml:"block-timeout"`
OutputFormat string `json:"output-format" yaml:"output-format"`
SignModeStr string `json:"sign-mode" yaml:"sign-mode"`
ExtraCodecs []string `json:"extra-codecs" yaml:"extra-codecs"`
Modules []module.AppModuleBasic `json:"-" yaml:"-"`
Slip44 *int `json:"coin-type" yaml:"coin-type"`
SigningAlgorithm string `json:"signing-algorithm" yaml:"signing-algorithm"`
Broadcast BroadcastMode `json:"broadcast-mode" yaml:"broadcast-mode"`
MinLoopDuration time.Duration `json:"min-loop-duration" yaml:"min-loop-duration"`

// If FeeGrantConfiguration is set, TXs submitted by the ChainClient will be signed by the FeeGrantees in a round-robin fashion by default.
FeeGrants *FeeGrantConfiguration `json:"feegrants" yaml:"feegrants"`
}

// FeeGrantConfiguration By default, TXs will be signed by the feegrantees 'ManagedGrantees' keys in a round-robin fashion.
// Clients can use other signing keys by invoking 'tx.SendMsgsWith' and specifying the signing key.
type FeeGrantConfiguration struct {
GranteesWanted int `json:"num_grantees" yaml:"num_grantees"`
// Normally this is the default ChainClient key
GranterKeyOrAddr string `json:"granter" yaml:"granter"`
// Whether we control the granter private key (if not, someone else must authorize our feegrants)
IsExternalGranter bool `json:"external_granter" yaml:"external_granter"`
// List of keys (by name) that this FeeGranter manages
ManagedGrantees []string `json:"grantees" yaml:"grantees"`
// Last checked on chain (0 means grants never checked and may not exist)
BlockHeightVerified int64 `json:"block_last_verified" yaml:"block_last_verified"`
// Index of the last ManagedGrantee used as a TX signer
GranteeLastSignerIndex int
KeyDirectory string `json:"key-directory" yaml:"key-directory"`
Key string `json:"key" yaml:"key"`
ChainName string `json:"-" yaml:"-"`
ChainID string `json:"chain-id" yaml:"chain-id"`
RPCAddr string `json:"rpc-addr" yaml:"rpc-addr"`
AccountPrefix string `json:"account-prefix" yaml:"account-prefix"`
KeyringBackend string `json:"keyring-backend" yaml:"keyring-backend"`
GasAdjustment float64 `json:"gas-adjustment" yaml:"gas-adjustment"`
GasPrices string `json:"gas-prices" yaml:"gas-prices"`
MinGasAmount uint64 `json:"min-gas-amount" yaml:"min-gas-amount"`
MaxGasAmount uint64 `json:"max-gas-amount" yaml:"max-gas-amount"`
Debug bool `json:"debug" yaml:"debug"`
Timeout string `json:"timeout" yaml:"timeout"`
BlockTimeout string `json:"block-timeout" yaml:"block-timeout"`
OutputFormat string `json:"output-format" yaml:"output-format"`
SignModeStr string `json:"sign-mode" yaml:"sign-mode"`
Broadcast BroadcastMode `json:"broadcast-mode" yaml:"broadcast-mode"`
}

type CosmosProvider struct {
Expand Down

0 comments on commit 561f681

Please sign in to comment.