From 1a5d673a86e2036854254c0547fccd8d7922d89b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Eckel?= Date: Thu, 3 Aug 2023 09:48:03 +0200 Subject: [PATCH] =?UTF-8?q?adjusted=20the=20default=20derivation=20path=20?= =?UTF-8?q?for=20the=20test=20cases=20to=20planetmint=E2=80=A6=20(#59)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * adjusted the default derivation path for the test cases to planetmint cointype * [test] Update sample.PubKey Changed due to updated derivation path. * [test] Set comment for DefaultDerivationPath --------- Signed-off-by: Jürgen Eckel Signed-off-by: Julian Strobl Co-authored-by: Julian Strobl --- tests/e2e/asset/suite.go | 3 +-- tests/e2e/machine/suite.go | 4 +--- testutil/sample/sample.go | 5 ++++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/e2e/asset/suite.go b/tests/e2e/asset/suite.go index 3437683..68785da 100644 --- a/tests/e2e/asset/suite.go +++ b/tests/e2e/asset/suite.go @@ -15,7 +15,6 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/crypto/types" - sdk "github.com/cosmos/cosmos-sdk/types" bank "github.com/cosmos/cosmos-sdk/x/bank/client/cli" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" @@ -42,7 +41,7 @@ func (s *E2ETestSuite) SetupSuite() { val := s.network.Validators[0] kb := val.ClientCtx.Keyring - account, err := kb.NewAccount(sample.Name, sample.Mnemonic, keyring.DefaultBIP39Passphrase, sdk.FullFundraiserPath, hd.Secp256k1) + account, err := kb.NewAccount(sample.Name, sample.Mnemonic, keyring.DefaultBIP39Passphrase, sample.DefaultDerivationPath, hd.Secp256k1) s.Require().NoError(err) addr, _ := account.GetAddress() diff --git a/tests/e2e/machine/suite.go b/tests/e2e/machine/suite.go index 78ef8ba..e1aef4a 100644 --- a/tests/e2e/machine/suite.go +++ b/tests/e2e/machine/suite.go @@ -14,8 +14,6 @@ import ( bank "github.com/cosmos/cosmos-sdk/x/bank/client/cli" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" - - sdk "github.com/cosmos/cosmos-sdk/types" ) // E2ETestSuite struct definition of machine suite @@ -39,7 +37,7 @@ func (s *E2ETestSuite) SetupSuite() { val := s.network.Validators[0] kb := val.ClientCtx.Keyring - account, err := kb.NewAccount(sample.Name, sample.Mnemonic, keyring.DefaultBIP39Passphrase, sdk.FullFundraiserPath, hd.Secp256k1) + account, err := kb.NewAccount(sample.Name, sample.Mnemonic, keyring.DefaultBIP39Passphrase, sample.DefaultDerivationPath, hd.Secp256k1) s.Require().NoError(err) addr, _ := account.GetAddress() diff --git a/testutil/sample/sample.go b/testutil/sample/sample.go index 2fdaee1..7c8a2d6 100644 --- a/testutil/sample/sample.go +++ b/testutil/sample/sample.go @@ -18,7 +18,7 @@ import ( const Mnemonic = "helmet hedgehog lab actor weekend elbow pelican valid obtain hungry rocket decade tower gallery fit practice cart cherry giggle hair snack glance bulb farm" // PubKey corresponding public key to sample mnemonic -const PubKey = "02328de87896b9cbb5101c335f40029e4be898988b470abbf683f1a0b318d73470" +const PubKey = "021cd2a59c6f9402ce09effba89b3deb6bb5863733e625f22c06204918061db4f0" // Name is the name of the sample machine to use in tests const Name = "machine" @@ -29,6 +29,9 @@ const Amount = "1000stake" // Fees is the amount of fees to use in tests const Fees = "2stake" +// DefaultDerivationPath is the BIP44Prefix for PLMNT (see https://github.com/satoshilabs/slips/blob/master/slip-0044.md) +const DefaultDerivationPath = "m/44'/8680'/0'/0/0" + // KeyPair returns a sample private / public keypair func KeyPair() (string, string) { secret := "Don't tell anybody"