forked from cerc-io/laconicd-deprecated
update fork
This commit is contained in:
1 parent
632d53e34a
commit
56d59feaa0
383 files changed
+36784
-21462
No files matched your search
@@ -4,25 +4,31 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
|
||||
hdwallet "github.com/miguelmota/go-ethereum-hdwallet"
|
||||
|
||||
cryptocodec "github.com/cerc-io/laconicd/crypto/codec"
|
||||
ethermint "github.com/cerc-io/laconicd/types"
|
||||
"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"
|
||||
|
||||
cryptocodec "github.com/cerc-io/laconicd/crypto/codec"
|
||||
enccodec "github.com/cerc-io/laconicd/encoding/codec"
|
||||
ethermint "github.com/cerc-io/laconicd/types"
|
||||
)
|
||||
|
||||
var protoCodec codec.Codec
|
||||
var TestCodec codec.Codec
|
||||
|
||||
func init() {
|
||||
protoCodec = codec.NewProtoCodec(codectypes.NewInterfaceRegistry())
|
||||
amino := codec.NewLegacyAmino()
|
||||
cryptocodec.RegisterCrypto(amino)
|
||||
cdc := codec.NewLegacyAmino()
|
||||
cryptocodec.RegisterCrypto(cdc)
|
||||
|
||||
interfaceRegistry := types.NewInterfaceRegistry()
|
||||
TestCodec = amino.NewProtoCodec(interfaceRegistry)
|
||||
enccodec.RegisterInterfaces(interfaceRegistry)
|
||||
}
|
||||
|
||||
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"
|
||||
@@ -31,7 +37,7 @@ func TestKeyring(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
mockIn := strings.NewReader("")
|
||||
|
||||
kr, err := keyring.New("ethermint", keyring.BackendTest, dir, mockIn, protoCodec, EthSecp256k1Option())
|
||||
kr, err := keyring.New("ethermint", keyring.BackendTest, dir, mockIn, TestCodec, EthSecp256k1Option())
|
||||
require.NoError(t, err)
|
||||
|
||||
// fail in retrieving key
|
||||
@@ -45,6 +51,9 @@ func TestKeyring(t *testing.T) {
|
||||
require.NotEmpty(t, mnemonic)
|
||||
require.Equal(t, "foo", info.Name)
|
||||
require.Equal(t, "local", info.GetType().String())
|
||||
pubKey, err := info.GetPubKey()
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, string(EthSecp256k1Type), pubKey.Type())
|
||||
|
||||
hdPath := ethermint.BIP44HDPath
|
||||
|
||||
|
||||
Reference in new issue
Block a user