Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
bing
Browse files Browse the repository at this point in the history
  • Loading branch information
Devon Bear committed Nov 1, 2023
1 parent 7278093 commit d23c3c1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions cosmos/crypto/keyring/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,15 @@
package keyring

import (
sdkhd "github.com/cosmos/cosmos-sdk/crypto/hd"
"github.com/cosmos/cosmos-sdk/crypto/keyring"

"pkg.berachain.dev/polaris/cosmos/crypto/hd"
)

// EthSecp256k1Option defines a function keys options for the ethereum Secp256k1 curve.
// It supports ethsecp256k1 and secp256k1 keys for accounts.
func EthSecp256k1Option() keyring.Option {
// OnlyEthSecp256k1Option defines a function keys options for the ethereum Secp256k1 curve.
func OnlyEthSecp256k1Option() keyring.Option {
return func(options *keyring.Options) {
options.SupportedAlgos = keyring.SigningAlgoList{hd.EthSecp256k1, sdkhd.Secp256k1}
options.SupportedAlgosLedger = keyring.SigningAlgoList{hd.EthSecp256k1, sdkhd.Secp256k1}
options.SupportedAlgos = keyring.SigningAlgoList{hd.EthSecp256k1}
options.SupportedAlgosLedger = keyring.SigningAlgoList{hd.EthSecp256k1}
}
}
2 changes: 1 addition & 1 deletion cosmos/crypto/keyring/option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var _ = Describe("Keyring", func() {
cryptocodec.RegisterInterfaces(interfaceRegistry)
cdc = codec.NewProtoCodec(interfaceRegistry)

kr, err = keyring.New("accounts", keyring.BackendTest, dir, mockIn, cdc, EthSecp256k1Option())
kr, err = keyring.New("accounts", keyring.BackendTest, dir, mockIn, cdc, OnlyEthSecp256k1Option())
Expect(err).NotTo(HaveOccurred())
})

Expand Down
2 changes: 1 addition & 1 deletion e2e/testapp/polard/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func NewRootCmd() *cobra.Command {
WithInput(os.Stdin).
WithAccountRetriever(types.AccountRetriever{}).
WithHomeDir(testapp.DefaultNodeHome).
WithKeyringOptions(keyring.EthSecp256k1Option()).
WithKeyringOptions(keyring.OnlyEthSecp256k1Option()).
WithViper("") // In simapp, we don't use any prefix for env variables.

ethcryptocodec.RegisterInterfaces(interfaceRegistry)
Expand Down

0 comments on commit d23c3c1

Please sign in to comment.