Skip to content

Commit

Permalink
fix: modify default coin type, default address prefix (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
Woosang Son authored Apr 23, 2021
1 parent 0072984 commit a8ba311
Show file tree
Hide file tree
Showing 47 changed files with 188 additions and 189 deletions.
1 change: 0 additions & 1 deletion client/keys/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ the flag --nosort is set.
cmd.Flags().Uint32(flagAccount, 0, "Account number for HD derivation")
cmd.Flags().Uint32(flagIndex, 0, "Address index number for HD derivation")
cmd.Flags().String(flags.FlagKeyAlgorithm, string(hd.Secp256k1Type), "Key signing algorithm to generate keys for")

cmd.SetOut(cmd.OutOrStdout())
cmd.SetErr(cmd.ErrOrStderr())

Expand Down
6 changes: 3 additions & 3 deletions client/keys/add_ledger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ func Test_runAddCmdLedgerWithCustomCoinType(t *testing.T) {
"terrapub1addwnpepqvpg7r26nl2pvqqern00m6s9uaax3hauu2rzg8qpjzq9hy6xve7sw0d84m6",
sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, key1.GetPubKey()))

config.SetCoinType(118)
config.SetFullFundraiserPath("44'/118'/0'/0/0")
config.SetCoinType(438)
config.SetFullFundraiserPath("44'/438'/0'/0/0")
config.SetBech32PrefixForAccount(sdk.Bech32PrefixAccAddr, sdk.Bech32PrefixAccPub)
config.SetBech32PrefixForValidator(sdk.Bech32PrefixValAddr, sdk.Bech32PrefixValPub)
config.SetBech32PrefixForConsensusNode(sdk.Bech32PrefixConsAddr, sdk.Bech32PrefixConsPub)
Expand Down Expand Up @@ -122,6 +122,6 @@ func Test_runAddCmdLedger(t *testing.T) {
require.Equal(t, "keyname1", key1.GetName())
require.Equal(t, keyring.TypeLedger, key1.GetType())
require.Equal(t,
"cosmospub1addwnpepqd87l8xhcnrrtzxnkql7k55ph8fr9jarf4hn6udwukfprlalu8lgw0urza0",
"linkpub1addwnpepq27djm9tzq3sftqsayx95refxk8r5jn0kyshhql9mdjhjx829zlvzszgelc",
sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, key1.GetPubKey()))
}
2 changes: 1 addition & 1 deletion client/keys/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ func Test_runExportCmd(t *testing.T) {
mockIn, mockOut := testutil.ApplyMockIO(cmd)
mockIn.Reset("y\n")
require.NoError(t, cmd.ExecuteContext(ctx))
require.Equal(t, "2485e33678db4175dc0ecef2d6e1fc493d4a0d7f7ce83324b6ed70afe77f3485\n", mockOut.String())
require.Equal(t, "d4bd5d54ee1b75abc6f5bab08e2e9d3a4b6dfbe6b50e2d6cf2426f3215633a1f\n", mockOut.String())
}
2 changes: 1 addition & 1 deletion codec/amino_codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func TestAminoCodecUnpackAnyFails(t *testing.T) {

func TestAminoCodecFullDecodeAndEncode(t *testing.T) {
// This tx comes from https://github.com/cosmos/cosmos-sdk/issues/8117.
txSigned := `{"type":"lbm-sdk/StdTx","value":{"msg":[{"type":"lbm-sdk/MsgCreateValidator","value":{"description":{"moniker":"fulltest","identity":"satoshi","website":"example.com","details":"example inc"},"commission":{"rate":"0.500000000000000000","max_rate":"1.000000000000000000","max_change_rate":"0.200000000000000000"},"min_self_delegation":"1000000","delegator_address":"cosmos14pt0q5cwf38zt08uu0n6yrstf3rndzr5057jys","validator_address":"cosmosvaloper14pt0q5cwf38zt08uu0n6yrstf3rndzr52q28gr","pubkey":{"type":"tendermint/PubKeyEd25519","value":"CYrOiM3HtS7uv1B1OAkknZnFYSRpQYSYII8AtMMtev0="},"value":{"denom":"umuon","amount":"700000000"}}}],"fee":{"amount":[{"denom":"umuon","amount":"6000"}],"gas":"160000"},"signatures":[{"pub_key":{"type":"tendermint/PubKeySecp256k1","value":"AwAOXeWgNf1FjMaayrSnrOOKz+Fivr6DiI/i0x0sZCHw"},"signature":"RcnfS/u2yl7uIShTrSUlDWvsXo2p2dYu6WJC8VDVHMBLEQZWc8bsINSCjOnlsIVkUNNe1q/WCA9n3Gy1+0zhYA=="}],"memo":"","timeout_height":"0"}}`
txSigned := `{"type":"lbm-sdk/StdTx","value":{"msg":[{"type":"lbm-sdk/MsgCreateValidator","value":{"description":{"moniker":"fulltest","identity":"satoshi","website":"example.com","details":"example inc"},"commission":{"rate":"0.500000000000000000","max_rate":"1.000000000000000000","max_change_rate":"0.200000000000000000"},"min_self_delegation":"1000000","delegator_address":"link120yvjfy7m2gnu9mvusrs40cxxhpt8nr3qhn8re","validator_address":"linkvaloper120yvjfy7m2gnu9mvusrs40cxxhpt8nr3jr36d2","pubkey":{"type":"tendermint/PubKeyEd25519","value":"CYrOiM3HtS7uv1B1OAkknZnFYSRpQYSYII8AtMMtev0="},"value":{"denom":"umuon","amount":"700000000"}}}],"fee":{"amount":[{"denom":"umuon","amount":"6000"}],"gas":"160000"},"signatures":[{"pub_key":{"type":"tendermint/PubKeySecp256k1","value":"AwAOXeWgNf1FjMaayrSnrOOKz+Fivr6DiI/i0x0sZCHw"},"signature":"RcnfS/u2yl7uIShTrSUlDWvsXo2p2dYu6WJC8VDVHMBLEQZWc8bsINSCjOnlsIVkUNNe1q/WCA9n3Gy1+0zhYA=="}],"memo":"","timeout_height":"0"}}`
_, legacyCdc := simapp.MakeCodecs()

var tx legacytx.StdTx
Expand Down
10 changes: 5 additions & 5 deletions crypto/hd/hdpath_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ func mnemonicToSeed(mnemonic string) []byte {

func TestStringifyFundraiserPathParams(t *testing.T) {
path := hd.NewFundraiserParams(4, types.CoinType, 22)
require.Equal(t, "m/44'/118'/4'/0/22", path.String())
require.Equal(t, "m/44'/438'/4'/0/22", path.String())

path = hd.NewFundraiserParams(4, types.CoinType, 57)
require.Equal(t, "m/44'/118'/4'/0/57", path.String())
require.Equal(t, "m/44'/438'/4'/0/57", path.String())

path = hd.NewFundraiserParams(4, 12345, 57)
require.Equal(t, "m/44'/12345'/4'/0/57", path.String())
Expand Down Expand Up @@ -200,7 +200,7 @@ func ExampleSomeBIP32TestVecs() {
seed := mnemonicToSeed("barrel original fuel morning among eternal " +
"filter ball stove pluck matrix mechanic")
master, ch := hd.ComputeMastersFromSeed(seed)
fmt.Println("keys from fundraiser test-vector (cosmos, bitcoin, ether)")
fmt.Println("keys from fundraiser test-vector (link, bitcoin, ether)")
fmt.Println()
// cosmos
priv, err := hd.DerivePrivateKeyForPath(master, ch, types.FullFundraiserPath)
Expand Down Expand Up @@ -264,9 +264,9 @@ func ExampleSomeBIP32TestVecs() {
priv, _ = hd.DerivePrivateKeyForPath(master, ch, "0/7")
fmt.Println(hex.EncodeToString(priv[:]))

// Output: keys from fundraiser test-vector (cosmos, bitcoin, ether)
// Output: keys from fundraiser test-vector (link, bitcoin, ether)
//
// bfcb217c058d8bbafd5e186eae936106ca3e943889b0b4a093ae13822fd3170c
// ae98c89aca32cb824f5b7ff94d7bf203e1f26d81787467d45422e4c7497342c9
// e77c3de76965ad89997451de97b95bb65ede23a6bf185a55d80363d92ee37c3d
// 7fc4d8a8146dea344ba04c593517d3f377fa6cded36cd55aee0a0bb968e651bc
// INVALID
Expand Down
20 changes: 10 additions & 10 deletions crypto/keyring/keyring_ledger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
func TestInMemoryCreateLedger(t *testing.T) {
kb := NewInMemory()

ledger, err := kb.SaveLedgerKey("some_account", hd.Secp256k1, "cosmos", 118, 3, 1)
ledger, err := kb.SaveLedgerKey("some_account", hd.Secp256k1, "link", 438, 3, 1)

if err != nil {
require.Error(t, err)
Expand All @@ -30,7 +30,7 @@ func TestInMemoryCreateLedger(t *testing.T) {
pubKey := ledger.GetPubKey()
pk, err := sdk.Bech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, pubKey)
require.NoError(t, err)
require.Equal(t, "cosmospub1addwnpepqdszcr95mrqqs8lw099aa9h8h906zmet22pmwe9vquzcgvnm93eqygufdlv", pk)
require.Equal(t, "linkpub1addwnpepqw830vud78huqu2dr5a6ptqn3rpjazec4krl6a5m4s955ywuur47zxh6gpv", pk)

// Check that restoring the key gets the same results
restoredKey, err := kb.Key("some_account")
Expand All @@ -41,11 +41,11 @@ func TestInMemoryCreateLedger(t *testing.T) {
pubKey = restoredKey.GetPubKey()
pk, err = sdk.Bech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, pubKey)
require.NoError(t, err)
require.Equal(t, "cosmospub1addwnpepqdszcr95mrqqs8lw099aa9h8h906zmet22pmwe9vquzcgvnm93eqygufdlv", pk)
require.Equal(t, "linkpub1addwnpepqw830vud78huqu2dr5a6ptqn3rpjazec4krl6a5m4s955ywuur47zxh6gpv", pk)

path, err := restoredKey.GetPath()
require.NoError(t, err)
require.Equal(t, "m/44'/118'/3'/0/1", path.String())
require.Equal(t, "m/44'/438'/3'/0/1", path.String())
}

// TestSignVerify does some detailed checks on how we sign and validate
Expand All @@ -56,7 +56,7 @@ func TestSignVerifyKeyRingWithLedger(t *testing.T) {
kb, err := New("keybasename", "test", dir, nil)
require.NoError(t, err)

i1, err := kb.SaveLedgerKey("key", hd.Secp256k1, "cosmos", 118, 0, 0)
i1, err := kb.SaveLedgerKey("key", hd.Secp256k1, "link", 438, 0, 0)
if err != nil {
require.Equal(t, "ledger nano S: support for ledger devices is not available in this executable", err.Error())
t.Skip("ledger nano S: support for ledger devices is not available in this executable")
Expand Down Expand Up @@ -94,10 +94,10 @@ func TestAltKeyring_SaveLedgerKey(t *testing.T) {
require.NoError(t, err)

// Test unsupported Algo
_, err = keyring.SaveLedgerKey("key", notSupportedAlgo{}, "cosmos", 118, 0, 0)
_, err = keyring.SaveLedgerKey("key", notSupportedAlgo{}, "link", 438, 0, 0)
require.EqualError(t, err, ErrUnsupportedSigningAlgo.Error())

ledger, err := keyring.SaveLedgerKey("some_account", hd.Secp256k1, "cosmos", 118, 3, 1)
ledger, err := keyring.SaveLedgerKey("some_account", hd.Secp256k1, "link", 438, 3, 1)
if err != nil {
require.Equal(t, "ledger nano S: support for ledger devices is not available in this executable", err.Error())
t.Skip("ledger nano S: support for ledger devices is not available in this executable")
Expand All @@ -108,7 +108,7 @@ func TestAltKeyring_SaveLedgerKey(t *testing.T) {
pubKey := ledger.GetPubKey()
pk, err := sdk.Bech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, pubKey)
require.NoError(t, err)
require.Equal(t, "cosmospub1addwnpepqdszcr95mrqqs8lw099aa9h8h906zmet22pmwe9vquzcgvnm93eqygufdlv", pk)
require.Equal(t, "linkpub1addwnpepqw830vud78huqu2dr5a6ptqn3rpjazec4krl6a5m4s955ywuur47zxh6gpv", pk)

// Check that restoring the key gets the same results
restoredKey, err := keyring.Key("some_account")
Expand All @@ -119,9 +119,9 @@ func TestAltKeyring_SaveLedgerKey(t *testing.T) {
pubKey = restoredKey.GetPubKey()
pk, err = sdk.Bech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, pubKey)
require.NoError(t, err)
require.Equal(t, "cosmospub1addwnpepqdszcr95mrqqs8lw099aa9h8h906zmet22pmwe9vquzcgvnm93eqygufdlv", pk)
require.Equal(t, "linkpub1addwnpepqw830vud78huqu2dr5a6ptqn3rpjazec4krl6a5m4s955ywuur47zxh6gpv", pk)

path, err := restoredKey.GetPath()
require.NoError(t, err)
require.Equal(t, "m/44'/118'/3'/0/1", path.String())
require.Equal(t, "m/44'/438'/3'/0/1", path.String())
}
4 changes: 2 additions & 2 deletions crypto/keyring/keyring_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func TestKeyManagementKeyRing(t *testing.T) {
require.NotNil(t, err)
_, err = kb.KeyByAddress(accAddr(i2))
require.NoError(t, err)
addr, err := sdk.AccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t")
addr, err := sdk.AccAddressFromBech32("link1yxfu3fldlgux939t0gwaqs82l4x77v2kasa7jf")
require.NoError(t, err)
_, err = kb.KeyByAddress(addr)
require.NotNil(t, err)
Expand Down Expand Up @@ -432,7 +432,7 @@ func TestInMemoryKeyManagement(t *testing.T) {
require.NotNil(t, err)
_, err = cstore.KeyByAddress(accAddr(i2))
require.NoError(t, err)
addr, err := sdk.AccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t")
addr, err := sdk.AccAddressFromBech32("link1yxfu3fldlgux939t0gwaqs82l4x77v2kasa7jf")
require.NoError(t, err)
_, err = cstore.KeyByAddress(addr)
require.NotNil(t, err)
Expand Down
2 changes: 1 addition & 1 deletion crypto/keyring/legacy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestLegacyKeybase(t *testing.T) {
require.NoError(t, err)
require.NotEmpty(t, armoredInfo)

importer, err := keyring.NewInfoImporter("cosmos", "memory", "", nil)
importer, err := keyring.NewInfoImporter("link", "memory", "", nil)
require.NoError(t, err)
err = importer.Import("test", "")
require.Error(t, err)
Expand Down
4 changes: 2 additions & 2 deletions crypto/keyring/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ func Test_writeReadLedgerInfo(t *testing.T) {

path, err := lInfo.GetPath()
require.NoError(t, err)
require.Equal(t, "m/44'/118'/5'/0/1", path.String())
require.Equal(t, "m/44'/438'/5'/0/1", path.String())
require.Equal(t,
"cosmospub1addwnpepqddddqg2glc8x4fl7vxjlnr7p5a3czm5kcdp4239sg6yqdc4rc2r5wmxv8p",
"linkpub1addwnpepqddddqg2glc8x4fl7vxjlnr7p5a3czm5kcdp4239sg6yqdc4rc2r5lef0hg",
sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, lInfo.GetPubKey()))

// Serialize and restore
Expand Down
72 changes: 36 additions & 36 deletions crypto/ledger/ledger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,32 @@ func TestPublicKeyUnsafe(t *testing.T) {
require.NoError(t, err)
require.NotNil(t, priv)

require.Equal(t, "eb5ae98721034fef9cd7c4c63588d3b03feb5281b9d232cba34d6f3d71aee59211ffbfe1fe87",
require.Equal(t, "eb5ae9872102bcd96cab102304ac10e90c5a0f29358e3a4a6fb1217b83e5db657918ea28bec1",
fmt.Sprintf("%x", cdc.Amino.MustMarshalBinaryBare(priv.PubKey())),
"Is your device using test mnemonic: %s ?", testutil.TestMnemonic)

pubKeyAddr, err := sdk.Bech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, priv.PubKey())
require.NoError(t, err)
require.Equal(t, "cosmospub1addwnpepqd87l8xhcnrrtzxnkql7k55ph8fr9jarf4hn6udwukfprlalu8lgw0urza0",
require.Equal(t, "linkpub1addwnpepq27djm9tzq3sftqsayx95refxk8r5jn0kyshhql9mdjhjx829zlvzszgelc",
pubKeyAddr, "Is your device using test mnemonic: %s ?", testutil.TestMnemonic)

addr := sdk.AccAddress(priv.PubKey().Address()).String()
require.Equal(t, "cosmos1w34k53py5v5xyluazqpq65agyajavep2rflq6h",
require.Equal(t, "link1tdl7n2acgmec0y5nng0q2fahl9khyct3cgsktn",
addr, "Is your device using test mnemonic: %s ?", testutil.TestMnemonic)
}

func TestPublicKeyUnsafeHDPath(t *testing.T) {
expectedAnswers := []string{
"cosmospub1addwnpepqd87l8xhcnrrtzxnkql7k55ph8fr9jarf4hn6udwukfprlalu8lgw0urza0",
"cosmospub1addwnpepqfsdqjr68h7wjg5wacksmqaypasnra232fkgu5sxdlnlu8j22ztxvlqvd65",
"cosmospub1addwnpepqw3xwqun6q43vtgw6p4qspq7srvxhcmvq4jrx5j5ma6xy3r7k6dtxmrkh3d",
"cosmospub1addwnpepqvez9lrp09g8w7gkv42y4yr5p6826cu28ydrhrujv862yf4njmqyyjr4pjs",
"cosmospub1addwnpepq06hw3enfrtmq8n67teytcmtnrgcr0yntmyt25kdukfjkerdc7lqg32rcz7",
"cosmospub1addwnpepqg3trf2gd0s2940nckrxherwqhgmm6xd5h4pcnrh4x7y35h6yafmcpk5qns",
"cosmospub1addwnpepqdm6rjpx6wsref8wjn7ym6ntejet430j4szpngfgc20caz83lu545vuv8hp",
"cosmospub1addwnpepqvdhtjzy2wf44dm03jxsketxc07vzqwvt3vawqqtljgsr9s7jvydjmt66ew",
"cosmospub1addwnpepqwystfpyxwcava7v3t7ndps5xzu6s553wxcxzmmnxevlzvwrlqpzz695nw9",
"cosmospub1addwnpepqw970u6gjqkccg9u3rfj99857wupj2z9fqfzy2w7e5dd7xn7kzzgkgqch0r",
"linkpub1addwnpepq27djm9tzq3sftqsayx95refxk8r5jn0kyshhql9mdjhjx829zlvzszgelc",
"linkpub1addwnpepqf258jtwpyujhxmlg94500j9yzqya5ryl835yp3dm6p9up25ufqcsjs2r6s",
"linkpub1addwnpepq2edmckd0zthve9r70err6ctxzqc4vt5648lu4fzqkld8dnaekzjcl9j5ft",
"linkpub1addwnpepqg9xfexl88nvmyyzpg5htz5qz30wgdftf0puz5u3sj6jkk9fxy7vzg7q5xn",
"linkpub1addwnpepqv09egt2l0u72a4h0stkcrx4hyz0z6mnxe5w5d7lzmmzfdj2mykj755jfdt",
"linkpub1addwnpepqfn9d7tew6vlr37sy9crsdud2gufsftm7wz3r2uhze2lfam4a263qsj6a8r",
"linkpub1addwnpepqfaq649vgk3levrsya2wkz8aecjxxd40rdfjhr6aqlld5ql54fds2yg7xpt",
"linkpub1addwnpepqv43zgg5dauwynq4wyqz3c6xtl9wcmc8z8ftgqvj87xs000lld6s63hlzt9",
"linkpub1addwnpepq0kchl479dz7f28hgfn7ve3txkktu9trq2dpmrzjy9awlyuf8w6x7nugtw7",
"linkpub1addwnpepqttsm9aacj9pq3w22xjms6lgyzxhhdjrrajt4hzzfl0melff9w9dq9e2ky7",
}

const numIters = 10
Expand Down Expand Up @@ -105,16 +105,16 @@ func TestPublicKeySafe(t *testing.T) {

require.Nil(t, ShowAddress(path, priv.PubKey(), sdk.GetConfig().GetBech32AccountAddrPrefix()))

require.Equal(t, "eb5ae98721034fef9cd7c4c63588d3b03feb5281b9d232cba34d6f3d71aee59211ffbfe1fe87",
require.Equal(t, "eb5ae9872102bcd96cab102304ac10e90c5a0f29358e3a4a6fb1217b83e5db657918ea28bec1",
fmt.Sprintf("%x", cdc.Amino.MustMarshalBinaryBare(priv.PubKey())),
"Is your device using test mnemonic: %s ?", testutil.TestMnemonic)

pubKeyAddr, err := sdk.Bech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, priv.PubKey())
require.NoError(t, err)
require.Equal(t, "cosmospub1addwnpepqd87l8xhcnrrtzxnkql7k55ph8fr9jarf4hn6udwukfprlalu8lgw0urza0",
require.Equal(t, "linkpub1addwnpepq27djm9tzq3sftqsayx95refxk8r5jn0kyshhql9mdjhjx829zlvzszgelc",
pubKeyAddr, "Is your device using test mnemonic: %s ?", testutil.TestMnemonic)

require.Equal(t, "cosmos1w34k53py5v5xyluazqpq65agyajavep2rflq6h",
require.Equal(t, "link1tdl7n2acgmec0y5nng0q2fahl9khyct3cgsktn",
addr, "Is your device using test mnemonic: %s ?", testutil.TestMnemonic)

addr2 := sdk.AccAddress(priv.PubKey().Address()).String()
Expand All @@ -123,29 +123,29 @@ func TestPublicKeySafe(t *testing.T) {

func TestPublicKeyHDPath(t *testing.T) {
expectedPubKeys := []string{
"cosmospub1addwnpepqd87l8xhcnrrtzxnkql7k55ph8fr9jarf4hn6udwukfprlalu8lgw0urza0",
"cosmospub1addwnpepqfsdqjr68h7wjg5wacksmqaypasnra232fkgu5sxdlnlu8j22ztxvlqvd65",
"cosmospub1addwnpepqw3xwqun6q43vtgw6p4qspq7srvxhcmvq4jrx5j5ma6xy3r7k6dtxmrkh3d",
"cosmospub1addwnpepqvez9lrp09g8w7gkv42y4yr5p6826cu28ydrhrujv862yf4njmqyyjr4pjs",
"cosmospub1addwnpepq06hw3enfrtmq8n67teytcmtnrgcr0yntmyt25kdukfjkerdc7lqg32rcz7",
"cosmospub1addwnpepqg3trf2gd0s2940nckrxherwqhgmm6xd5h4pcnrh4x7y35h6yafmcpk5qns",
"cosmospub1addwnpepqdm6rjpx6wsref8wjn7ym6ntejet430j4szpngfgc20caz83lu545vuv8hp",
"cosmospub1addwnpepqvdhtjzy2wf44dm03jxsketxc07vzqwvt3vawqqtljgsr9s7jvydjmt66ew",
"cosmospub1addwnpepqwystfpyxwcava7v3t7ndps5xzu6s553wxcxzmmnxevlzvwrlqpzz695nw9",
"cosmospub1addwnpepqw970u6gjqkccg9u3rfj99857wupj2z9fqfzy2w7e5dd7xn7kzzgkgqch0r",
"linkpub1addwnpepq27djm9tzq3sftqsayx95refxk8r5jn0kyshhql9mdjhjx829zlvzszgelc",
"linkpub1addwnpepqf258jtwpyujhxmlg94500j9yzqya5ryl835yp3dm6p9up25ufqcsjs2r6s",
"linkpub1addwnpepq2edmckd0zthve9r70err6ctxzqc4vt5648lu4fzqkld8dnaekzjcl9j5ft",
"linkpub1addwnpepqg9xfexl88nvmyyzpg5htz5qz30wgdftf0puz5u3sj6jkk9fxy7vzg7q5xn",
"linkpub1addwnpepqv09egt2l0u72a4h0stkcrx4hyz0z6mnxe5w5d7lzmmzfdj2mykj755jfdt",
"linkpub1addwnpepqfn9d7tew6vlr37sy9crsdud2gufsftm7wz3r2uhze2lfam4a263qsj6a8r",
"linkpub1addwnpepqfaq649vgk3levrsya2wkz8aecjxxd40rdfjhr6aqlld5ql54fds2yg7xpt",
"linkpub1addwnpepqv43zgg5dauwynq4wyqz3c6xtl9wcmc8z8ftgqvj87xs000lld6s63hlzt9",
"linkpub1addwnpepq0kchl479dz7f28hgfn7ve3txkktu9trq2dpmrzjy9awlyuf8w6x7nugtw7",
"linkpub1addwnpepqttsm9aacj9pq3w22xjms6lgyzxhhdjrrajt4hzzfl0melff9w9dq9e2ky7",
}

expectedAddrs := []string{
"cosmos1w34k53py5v5xyluazqpq65agyajavep2rflq6h",
"cosmos19ewxwemt6uahejvwf44u7dh6tq859tkyvarh2q",
"cosmos1a07dzdjgjsntxpp75zg7cgatgq0udh3pcdcxm3",
"cosmos1qvw52lmn9gpvem8welghrkc52m3zczyhlqjsl7",
"cosmos17m78ka80fqkkw2c4ww0v4xm5nsu2drgrlm8mn2",
"cosmos1ferh9ll9c452d2p8k2v7heq084guygkn43up9e",
"cosmos10vf3sxmjg96rqq36axcphzfsl74dsntuehjlw5",
"cosmos1cq83av8cmnar79h0rg7duh9gnr7wkh228a7fxg",
"cosmos1dszhfrt226jy5rsre7e48vw9tgwe90uerfyefa",
"cosmos1734d7qsylzrdt05muhqqtpd90j8mp4y6rzch8l",
"link1tdl7n2acgmec0y5nng0q2fahl9khyct3cgsktn",
"link1lzmehungm97jh0nme768v9wv28l8jr2dkkv357",
"link1p0yx9c9q4xsnedlcn24gqfry5dcu6e9xkhv9aj",
"link1cjjev0yzp90dxhsyxlxkwvrgl6vdw5p7qpxgfu",
"link1gf58l6wlscadkw2c9dpyd8se4hw37gu0zxx2g6",
"link1n93v9h6slh2e56lfu6vcy302f6ttxv5tt676ej",
"link124w2ltcv7wdhc85g07kta7yc4pwqk9qqsfq3c0",
"link17evhyfgwm70xjy8s3la64ek2x068aqezs24lth",
"link1clgcsmd9gcu4v9ec0qzqpr932aetwrqkxwswdh",
"link1hcttwju93d5m39467gjcq63p5kc4fdcn30dgd8",
}

const numIters = 10
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/adr-024-coin-metadata_genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"balances": [
{
"address": "cosmos106vrzv5xkheqhjm023pxcxlqmcjvuhtfyachz4",
"address": "link1wjfgxvmff06nqkzlnuhhdmm5d55lvffn5xym0g",
"coins": [
{
"denom": "nametoken",
Expand Down
10 changes: 5 additions & 5 deletions types/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ const (
// AddrLen defines a valid address length
AddrLen = 20
// Bech32MainPrefix defines the main SDK Bech32 prefix of an account's address
Bech32MainPrefix = "cosmos"
Bech32MainPrefix = "link"

// CoinType is the ATOM coin type as defined in SLIP44 (https://github.com/satoshilabs/slips/blob/master/slip-0044.md)
CoinType = 118
// CoinType is the LINK coin type as defined in SLIP44 (https://github.com/satoshilabs/slips/blob/master/slip-0044.md)
CoinType = 438

// FullFundraiserPath is the parts of the BIP44 HD path that are fixed by
// what we used during the ATOM fundraiser.
FullFundraiserPath = "m/44'/118'/0'/0/0"
// what we used during the LINK fundraiser.
FullFundraiserPath = "m/44'/438'/0'/0/0"

// PrefixAccount is the prefix for account keys
PrefixAccount = "acc"
Expand Down
2 changes: 1 addition & 1 deletion types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

// DefaultKeyringServiceName defines a default service name for the keyring.
const DefaultKeyringServiceName = "cosmos"
const DefaultKeyringServiceName = "lbm"

// Config is the structure that holds the SDK configuration parameters.
// This could be used to initialize certain configuration parameters for the SDK.
Expand Down
Loading

0 comments on commit a8ba311

Please sign in to comment.