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

fix: enable fixIssue172 flag for test #1447

Merged
merged 12 commits into from
Nov 23, 2022
11 changes: 8 additions & 3 deletions crypto/hd/algorithm_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package hd

import (
"os"
"strings"
"testing"

Expand All @@ -10,7 +11,6 @@ import (

hdwallet "github.com/miguelmota/go-ethereum-hdwallet"

"github.com/cosmos/cosmos-sdk/codec"
amino "github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
Expand All @@ -20,10 +20,10 @@ import (
ethermint "github.com/evmos/ethermint/types"
)

var TestCodec codec.Codec
var TestCodec amino.Codec

func init() {
cdc := codec.NewLegacyAmino()
cdc := amino.NewLegacyAmino()
cryptocodec.RegisterCrypto(cdc)

interfaceRegistry := types.NewInterfaceRegistry()
Expand All @@ -34,6 +34,11 @@ func init() {
const mnemonic = "picnic rent average infant boat squirrel federal assault mercy purity very motor fossil wheel verify upset box fresh horse vivid copy predict square regret"
fedekunze marked this conversation as resolved.
Show resolved Hide resolved

func TestKeyring(t *testing.T) {
// hdWalletFixEnv defines whether the standard (correct) bip39
// derivation path was used, or if derivation was affected by
// https://github.com/btcsuite/btcutil/issues/172
const hdWalletFixEnv = "GO_ETHEREUM_HDWALLET_FIX_ISSUE_179"
fedekunze marked this conversation as resolved.
Show resolved Hide resolved
os.Setenv(hdWalletFixEnv, "true")
dir := t.TempDir()
mockIn := strings.NewReader("")

Expand Down