Skip to content

Commit

Permalink
fix(keychain-sdk): remove DerivationPath configuration param
Browse files Browse the repository at this point in the history
  • Loading branch information
Pitasi committed Sep 9, 2024
1 parent 642975c commit c9839a3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 27 deletions.
34 changes: 16 additions & 18 deletions cmd/wardenkms/wardenkms.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ import (
)

type Config struct {
ChainID string `env:"CHAIN_ID, default=warden_1337-1"`
GRPCURL string `env:"GRPC_URL, default=localhost:9090"`
GRPCInsecure bool `env:"GRPC_INSECURE, default=true"`
DerivationPath string `env:"DERIVATION_PATH, default=m/44'/60'/0'/0/0"`
Mnemonic string `env:"MNEMONIC, default=exclude try nephew main caught favorite tone degree lottery device tissue tent ugly mouse pelican gasp lava flush pen river noise remind balcony emerge"`
KeychainId uint64 `env:"KEYCHAIN_ID, default=1"`
ChainID string `env:"CHAIN_ID, default=warden_1337-1"`
GRPCURL string `env:"GRPC_URL, default=localhost:9090"`
GRPCInsecure bool `env:"GRPC_INSECURE, default=true"`
Mnemonic string `env:"MNEMONIC, default=exclude try nephew main caught favorite tone degree lottery device tissue tent ugly mouse pelican gasp lava flush pen river noise remind balcony emerge"`
KeychainId uint64 `env:"KEYCHAIN_ID, default=1"`

KeyringMnemonic string `env:"KEYRING_MNEMONIC, required"`
KeyringPassword string `env:"KEYRING_PASSWORD, required"`
Expand Down Expand Up @@ -58,18 +57,17 @@ func main() {
}

app := keychain.NewApp(keychain.Config{
Logger: logger,
ChainID: cfg.ChainID,
GRPCURL: cfg.GRPCURL,
GRPCInsecure: cfg.GRPCInsecure,
DerivationPath: cfg.DerivationPath,
Mnemonic: cfg.Mnemonic,
KeychainID: cfg.KeychainId,
GasLimit: cfg.GasLimit,
BatchInterval: cfg.BatchInterval,
BatchSize: cfg.BatchSize,
TxTimeout: cfg.TxTimeout,
TxFees: sdk.NewCoins(sdk.NewCoin("award", math.NewInt(cfg.TxFee))),
Logger: logger,
ChainID: cfg.ChainID,
GRPCURL: cfg.GRPCURL,
GRPCInsecure: cfg.GRPCInsecure,
Mnemonic: cfg.Mnemonic,
KeychainID: cfg.KeychainId,
GasLimit: cfg.GasLimit,
BatchInterval: cfg.BatchInterval,
BatchSize: cfg.BatchSize,
TxTimeout: cfg.TxTimeout,
TxFees: sdk.NewCoins(sdk.NewCoin("award", math.NewInt(cfg.TxFee))),
})

app.SetKeyRequestHandler(func(w keychain.KeyResponseWriter, req *keychain.KeyRequest) {
Expand Down
5 changes: 0 additions & 5 deletions keychain-sdk/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ type Config struct {
// for.
KeychainID uint64

// DerivationPath is the derivation path to use in combination with the
// [Mnemonic] to derive this Keychain's writer private key.
// e.g. "m/44'/60'/0'/0/0"
DerivationPath string

// Mnemonic is the mnemonic to use to derive this Keychain's writer private
// key.
Mnemonic string
Expand Down
5 changes: 2 additions & 3 deletions keychain-sdk/example_keychain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ func Main() {
GRPCInsecure: true,

// setup the account used to write txs
KeychainID: 1,
Mnemonic: "virus boat radio apple pilot ask vault exhaust again state doll stereo slide exhibit scissors miss attack boat budget egg bird mask more trick",
DerivationPath: "m/44'/60'/0'/0/0",
KeychainID: 1,
Mnemonic: "virus boat radio apple pilot ask vault exhaust again state doll stereo slide exhibit scissors miss attack boat budget egg bird mask more trick",

// setup throughput for batching responses
GasLimit: 400000,
Expand Down
2 changes: 1 addition & 1 deletion keychain-sdk/keychain.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (a *App) initConnections() error {

conn := query.Conn()

identity, err := client.NewIdentityFromSeed(a.config.DerivationPath, a.config.Mnemonic)
identity, err := client.NewIdentityFromSeed(a.config.Mnemonic)
if err != nil {
return fmt.Errorf("failed to create identity: %w", err)
}
Expand Down

0 comments on commit c9839a3

Please sign in to comment.