From 2d7bba2bf01a6ca6bc28c1889ee9f312234cbaa3 Mon Sep 17 00:00:00 2001 From: "riccardo.montagnin" Date: Thu, 18 Feb 2021 11:48:36 +0100 Subject: [PATCH 1/8] Removed the SetFullFundraiserPath in favor of SetPurpose and SetCoinType and renamed GetFullFundraiserPath to GetFullBip44Path --- client/keys/add_ledger_test.go | 4 ++-- client/keys/delete_test.go | 2 +- client/keys/export_test.go | 2 +- client/keys/list_test.go | 2 +- types/address.go | 5 +++- types/config.go | 42 +++++++++++++++++++++------------- types/config_test.go | 24 +++++++++---------- 7 files changed, 47 insertions(+), 34 deletions(-) diff --git a/client/keys/add_ledger_test.go b/client/keys/add_ledger_test.go index b8ba1ec7f59e..5e32f755f70e 100644 --- a/client/keys/add_ledger_test.go +++ b/client/keys/add_ledger_test.go @@ -29,8 +29,8 @@ func Test_runAddCmdLedgerWithCustomCoinType(t *testing.T) { bech32PrefixConsAddr := "terravalcons" bech32PrefixConsPub := "terravalconspub" + config.SetPurpose(44) config.SetCoinType(330) - config.SetFullFundraiserPath("44'/330'/0'/0/0") config.SetBech32PrefixForAccount(bech32PrefixAccAddr, bech32PrefixAccPub) config.SetBech32PrefixForValidator(bech32PrefixValAddr, bech32PrefixValPub) config.SetBech32PrefixForConsensusNode(bech32PrefixConsAddr, bech32PrefixConsPub) @@ -77,8 +77,8 @@ func Test_runAddCmdLedgerWithCustomCoinType(t *testing.T) { "terrapub1addwnpepqvpg7r26nl2pvqqern00m6s9uaax3hauu2rzg8qpjzq9hy6xve7sw0d84m6", sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, key1.GetPubKey())) + config.SetPurpose(44) config.SetCoinType(118) - config.SetFullFundraiserPath("44'/118'/0'/0/0") config.SetBech32PrefixForAccount(sdk.Bech32PrefixAccAddr, sdk.Bech32PrefixAccPub) config.SetBech32PrefixForValidator(sdk.Bech32PrefixValAddr, sdk.Bech32PrefixValPub) config.SetBech32PrefixForConsensusNode(sdk.Bech32PrefixConsAddr, sdk.Bech32PrefixConsPub) diff --git a/client/keys/delete_test.go b/client/keys/delete_test.go index 5a0013967196..af1326e7a7d7 100644 --- a/client/keys/delete_test.go +++ b/client/keys/delete_test.go @@ -31,7 +31,7 @@ func Test_runDeleteCmd(t *testing.T) { fakeKeyName1 := "runDeleteCmd_Key1" fakeKeyName2 := "runDeleteCmd_Key2" - path := sdk.GetConfig().GetFullFundraiserPath() + path := sdk.GetConfig().GetFullBip44Path() kb, err := keyring.New(sdk.KeyringServiceName(), keyring.BackendTest, kbHome, mockIn) require.NoError(t, err) diff --git a/client/keys/export_test.go b/client/keys/export_test.go index b01bbf823023..3a9653793034 100644 --- a/client/keys/export_test.go +++ b/client/keys/export_test.go @@ -31,7 +31,7 @@ func Test_runExportCmd(t *testing.T) { kb.Delete("keyname1") // nolint:errcheck }) - path := sdk.GetConfig().GetFullFundraiserPath() + path := sdk.GetConfig().GetFullBip44Path() _, err = kb.NewAccount("keyname1", testutil.TestMnemonic, "", path, hd.Secp256k1) require.NoError(t, err) diff --git a/client/keys/list_test.go b/client/keys/list_test.go index 5904f74bfdd2..cfe08d1d6075 100644 --- a/client/keys/list_test.go +++ b/client/keys/list_test.go @@ -30,7 +30,7 @@ func Test_runListCmd(t *testing.T) { clientCtx := client.Context{}.WithKeyring(kb) ctx := context.WithValue(context.Background(), client.ClientContextKey, &clientCtx) - path := "" //sdk.GetConfig().GetFullFundraiserPath() + path := "" //sdk.GetConfig().GetFullBip44Path() _, err = kb.NewAccount("something", testutil.TestMnemonic, "", path, hd.Secp256k1) require.NoError(t, err) diff --git a/types/address.go b/types/address.go index eabff6fa97ee..1458328bd610 100644 --- a/types/address.go +++ b/types/address.go @@ -26,13 +26,16 @@ const ( // config.SetBech32PrefixForAccount(yourBech32PrefixAccAddr, yourBech32PrefixAccPub) // config.SetBech32PrefixForValidator(yourBech32PrefixValAddr, yourBech32PrefixValPub) // config.SetBech32PrefixForConsensusNode(yourBech32PrefixConsAddr, yourBech32PrefixConsPub) + // config.SetPurpose(yourPurpose) // config.SetCoinType(yourCoinType) - // config.SetFullFundraiserPath(yourFullFundraiserPath) // config.Seal() // Bech32MainPrefix defines the main SDK Bech32 prefix of an account's address Bech32MainPrefix = "cosmos" + // Purpose is the ATOM purpose as defined in SLIP44 (https://github.com/satoshilabs/slips/blob/master/slip-0044.md) + Purpose = 44 + // CoinType is the ATOM coin type as defined in SLIP44 (https://github.com/satoshilabs/slips/blob/master/slip-0044.md) CoinType = 118 diff --git a/types/config.go b/types/config.go index a3181703df1e..fd1ba4408bae 100644 --- a/types/config.go +++ b/types/config.go @@ -2,6 +2,7 @@ package types import ( "context" + "fmt" "sync" "github.com/cosmos/cosmos-sdk/version" @@ -13,14 +14,17 @@ const DefaultKeyringServiceName = "cosmos" // Config is the structure that holds the SDK configuration parameters. // This could be used to initialize certain configuration parameters for the SDK. type Config struct { - fullFundraiserPath string bech32AddressPrefix map[string]string txEncoder TxEncoder addressVerifier func([]byte) error mtx sync.RWMutex - coinType uint32 - sealed bool - sealedch chan struct{} + + // SLIP-44 related + purpose uint32 + coinType uint32 + + sealed bool + sealedch chan struct{} } // cosmos-sdk wide global singleton @@ -41,9 +45,10 @@ func NewConfig() *Config { "validator_pub": Bech32PrefixValPub, "consensus_pub": Bech32PrefixConsPub, }, - coinType: CoinType, - fullFundraiserPath: FullFundraiserPath, - txEncoder: nil, + + purpose: Purpose, + coinType: CoinType, + txEncoder: nil, } } @@ -112,16 +117,16 @@ func (config *Config) SetAddressVerifier(addressVerifier func([]byte) error) { config.addressVerifier = addressVerifier } -// Set the BIP-0044 CoinType code on the config -func (config *Config) SetCoinType(coinType uint32) { +// Set the BIP-0044 Purpose code on the config +func (config *Config) SetPurpose(purpose uint32) { config.assertNotSealed() - config.coinType = coinType + config.purpose = purpose } -// Set the FullFundraiserPath (BIP44Prefix) on the config -func (config *Config) SetFullFundraiserPath(fullFundraiserPath string) { +// Set the BIP-0044 CoinType code on the config +func (config *Config) SetCoinType(coinType uint32) { config.assertNotSealed() - config.fullFundraiserPath = fullFundraiserPath + config.coinType = coinType } // Seal seals the config such that the config state could not be modified further @@ -181,14 +186,19 @@ func (config *Config) GetAddressVerifier() func([]byte) error { return config.addressVerifier } +// GetPurpose returns the BIP-0044 Purpose code on the config. +func (config *Config) GetPurpose() uint32 { + return config.purpose +} + // GetCoinType returns the BIP-0044 CoinType code on the config. func (config *Config) GetCoinType() uint32 { return config.coinType } -// GetFullFundraiserPath returns the BIP44Prefix. -func (config *Config) GetFullFundraiserPath() string { - return config.fullFundraiserPath +// GetFullBip44Path returns the BIP44Prefix. +func (config *Config) GetFullBip44Path() string { + return fmt.Sprintf("m/%d'/%d'/0'/0/0", config.purpose, config.coinType) } func KeyringServiceName() string { diff --git a/types/config_test.go b/types/config_test.go index e2027f38569f..4ace3fe53a93 100644 --- a/types/config_test.go +++ b/types/config_test.go @@ -17,6 +17,18 @@ func TestConfigTestSuite(t *testing.T) { suite.Run(t, new(configTestSuite)) } +func (s *contextTestSuite) TestConfig_SetPurpose() { + config := sdk.NewConfig() + config.SetPurpose(44) + s.Require().Equal(uint32(44), config.GetPurpose()) + + config.SetPurpose(0) + s.Require().Equal(uint32(0), config.GetPurpose()) + + config.Seal() + s.Require().Panics(func() { config.SetPurpose(10) }) +} + func (s *configTestSuite) TestConfig_SetCoinType() { config := sdk.NewConfig() config.SetCoinType(1) @@ -41,18 +53,6 @@ func (s *configTestSuite) TestConfig_SetTxEncoder() { s.Require().Panics(func() { config.SetTxEncoder(encFunc) }) } -func (s *configTestSuite) TestConfig_SetFullFundraiserPath() { - config := sdk.NewConfig() - config.SetFullFundraiserPath("test/path") - s.Require().Equal("test/path", config.GetFullFundraiserPath()) - - config.SetFullFundraiserPath("test/poth") - s.Require().Equal("test/poth", config.GetFullFundraiserPath()) - - config.Seal() - s.Require().Panics(func() { config.SetFullFundraiserPath("x/test/path") }) -} - func (s *configTestSuite) TestKeyringServiceName() { s.Require().Equal(sdk.DefaultKeyringServiceName, sdk.KeyringServiceName()) } From c42b9dafeea0961807a64a35b1518d43793b5611 Mon Sep 17 00:00:00 2001 From: "riccardo.montagnin" Date: Mon, 22 Feb 2021 07:26:18 +0100 Subject: [PATCH 2/8] Added CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45c93da693c5..45f1a74b7650 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/gov) [\#8473](https://github.com/cosmos/cosmos-sdk/pull/8473) On genesis init, if the gov module account balance, coming from bank module state, does not match the one in gov module state, the initialization will panic. * (x/distribution) [\#8473](https://github.com/cosmos/cosmos-sdk/pull/8473) On genesis init, if the distribution module account balance, coming from bank module state, does not match the one in distribution module state, the initialization will panic. * (client/keys) [\#8500](https://github.com/cosmos/cosmos-sdk/pull/8500) `InfoImporter` interface is removed from legacy keybase. +* [\#8629](https://github.com/cosmos/cosmos-sdk/pull/8629) Removed `SetFullFundraiserPath` from `Config` in favor of `SetPurpose` and `SetCoinType`. ### State Machine Breaking From e623a062d2653648ffdbf131780c48d7bea1197d Mon Sep 17 00:00:00 2001 From: "riccardo.montagnin" Date: Mon, 22 Feb 2021 12:33:25 +0100 Subject: [PATCH 3/8] Brought back SetFullFundraiserPath and GetFullFundraiserPath deprecating them --- types/config.go | 17 +++++++++++++++++ types/config_test.go | 12 ++++++++++++ x/authz/types/authorization_grant.go | 3 ++- x/staking/types/authz.go | 3 ++- x/staking/types/authz_test.go | 3 ++- 5 files changed, 35 insertions(+), 3 deletions(-) diff --git a/types/config.go b/types/config.go index fd1ba4408bae..36e029a9484e 100644 --- a/types/config.go +++ b/types/config.go @@ -14,6 +14,7 @@ const DefaultKeyringServiceName = "cosmos" // Config is the structure that holds the SDK configuration parameters. // This could be used to initialize certain configuration parameters for the SDK. type Config struct { + fullFundraiserPath string bech32AddressPrefix map[string]string txEncoder TxEncoder addressVerifier func([]byte) error @@ -45,6 +46,7 @@ func NewConfig() *Config { "validator_pub": Bech32PrefixValPub, "consensus_pub": Bech32PrefixConsPub, }, + fullFundraiserPath: FullFundraiserPath, purpose: Purpose, coinType: CoinType, @@ -117,6 +119,14 @@ func (config *Config) SetAddressVerifier(addressVerifier func([]byte) error) { config.addressVerifier = addressVerifier } +// Set the FullFundraiserPath (BIP44Prefix) on the config. +// +// Deprecated: Use SetPurpose and SetCoinType instead +func (config *Config) SetFullFundraiserPath(fullFundraiserPath string) { + config.assertNotSealed() + config.fullFundraiserPath = fullFundraiserPath +} + // Set the BIP-0044 Purpose code on the config func (config *Config) SetPurpose(purpose uint32) { config.assertNotSealed() @@ -196,6 +206,13 @@ func (config *Config) GetCoinType() uint32 { return config.coinType } +// GetFullFundraiserPath returns the BIP44Prefix. +// +// Deprecated: Use GetFullBip44Path instead +func (config *Config) GetFullFundraiserPath() string { + return config.fullFundraiserPath +} + // GetFullBip44Path returns the BIP44Prefix. func (config *Config) GetFullBip44Path() string { return fmt.Sprintf("m/%d'/%d'/0'/0/0", config.purpose, config.coinType) diff --git a/types/config_test.go b/types/config_test.go index 4ace3fe53a93..54a1fe48b527 100644 --- a/types/config_test.go +++ b/types/config_test.go @@ -17,6 +17,18 @@ func TestConfigTestSuite(t *testing.T) { suite.Run(t, new(configTestSuite)) } +func (s *configTestSuite) TestConfig_SetFullFundraiserPath() { + config := sdk.NewConfig() + config.SetFullFundraiserPath("test/path") + s.Require().Equal("test/path", config.GetFullFundraiserPath()) + + config.SetFullFundraiserPath("test/poth") + s.Require().Equal("test/poth", config.GetFullFundraiserPath()) + + config.Seal() + s.Require().Panics(func() { config.SetFullFundraiserPath("x/test/path") }) +} + func (s *contextTestSuite) TestConfig_SetPurpose() { config := sdk.NewConfig() config.SetPurpose(44) diff --git a/x/authz/types/authorization_grant.go b/x/authz/types/authorization_grant.go index c94e9d6d730a..03a83bdefd5c 100644 --- a/x/authz/types/authorization_grant.go +++ b/x/authz/types/authorization_grant.go @@ -3,10 +3,11 @@ package types import ( "time" + proto "github.com/gogo/protobuf/proto" + "github.com/cosmos/cosmos-sdk/codec/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/authz/exported" - proto "github.com/gogo/protobuf/proto" ) // NewAuthorizationGrant returns new AuthrizationGrant diff --git a/x/staking/types/authz.go b/x/staking/types/authz.go index aae9b706f1fe..e88288da4e2d 100644 --- a/x/staking/types/authz.go +++ b/x/staking/types/authz.go @@ -1,10 +1,11 @@ package types import ( + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" authz "github.com/cosmos/cosmos-sdk/x/authz/exported" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" ) var ( diff --git a/x/staking/types/authz_test.go b/x/staking/types/authz_test.go index 7f5dd2c22c10..18709d9ecd51 100644 --- a/x/staking/types/authz_test.go +++ b/x/staking/types/authz_test.go @@ -5,9 +5,10 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/stretchr/testify/require" ) var ( From 42ab70a5db3c956e39cf284809eee97428521838 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Mon, 22 Feb 2021 11:47:31 +0000 Subject: [PATCH 4/8] Update types/config.go --- types/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/config.go b/types/config.go index 36e029a9484e..a5951542f991 100644 --- a/types/config.go +++ b/types/config.go @@ -121,7 +121,7 @@ func (config *Config) SetAddressVerifier(addressVerifier func([]byte) error) { // Set the FullFundraiserPath (BIP44Prefix) on the config. // -// Deprecated: Use SetPurpose and SetCoinType instead +// Deprecated: This method is supported for backward compatibility only and will be removed in a future release. Use SetPurpose and SetCoinType instead. func (config *Config) SetFullFundraiserPath(fullFundraiserPath string) { config.assertNotSealed() config.fullFundraiserPath = fullFundraiserPath From 5a42c5ad46dc945d8c08631fb804a044d4d20cef Mon Sep 17 00:00:00 2001 From: "riccardo.montagnin" Date: Mon, 22 Feb 2021 12:59:54 +0100 Subject: [PATCH 5/8] Updated method name --- client/keys/delete_test.go | 2 +- client/keys/export_test.go | 2 +- client/keys/list_test.go | 2 +- types/config.go | 6 +++--- types/config_test.go | 24 ++++++++++++------------ 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/client/keys/delete_test.go b/client/keys/delete_test.go index af1326e7a7d7..49da92bf1f72 100644 --- a/client/keys/delete_test.go +++ b/client/keys/delete_test.go @@ -31,7 +31,7 @@ func Test_runDeleteCmd(t *testing.T) { fakeKeyName1 := "runDeleteCmd_Key1" fakeKeyName2 := "runDeleteCmd_Key2" - path := sdk.GetConfig().GetFullBip44Path() + path := sdk.GetConfig().GetFullBIP44Path() kb, err := keyring.New(sdk.KeyringServiceName(), keyring.BackendTest, kbHome, mockIn) require.NoError(t, err) diff --git a/client/keys/export_test.go b/client/keys/export_test.go index 3a9653793034..782af754024f 100644 --- a/client/keys/export_test.go +++ b/client/keys/export_test.go @@ -31,7 +31,7 @@ func Test_runExportCmd(t *testing.T) { kb.Delete("keyname1") // nolint:errcheck }) - path := sdk.GetConfig().GetFullBip44Path() + path := sdk.GetConfig().GetFullBIP44Path() _, err = kb.NewAccount("keyname1", testutil.TestMnemonic, "", path, hd.Secp256k1) require.NoError(t, err) diff --git a/client/keys/list_test.go b/client/keys/list_test.go index cfe08d1d6075..17f8dd8e4f94 100644 --- a/client/keys/list_test.go +++ b/client/keys/list_test.go @@ -30,7 +30,7 @@ func Test_runListCmd(t *testing.T) { clientCtx := client.Context{}.WithKeyring(kb) ctx := context.WithValue(context.Background(), client.ClientContextKey, &clientCtx) - path := "" //sdk.GetConfig().GetFullBip44Path() + path := "" //sdk.GetConfig().GetFullBIP44Path() _, err = kb.NewAccount("something", testutil.TestMnemonic, "", path, hd.Secp256k1) require.NoError(t, err) diff --git a/types/config.go b/types/config.go index a5951542f991..00b701a025d7 100644 --- a/types/config.go +++ b/types/config.go @@ -208,13 +208,13 @@ func (config *Config) GetCoinType() uint32 { // GetFullFundraiserPath returns the BIP44Prefix. // -// Deprecated: Use GetFullBip44Path instead +// Deprecated: This method is supported for backward compatibility only and will be removed in a future release. Use GetFullBIP44Path instead. func (config *Config) GetFullFundraiserPath() string { return config.fullFundraiserPath } -// GetFullBip44Path returns the BIP44Prefix. -func (config *Config) GetFullBip44Path() string { +// GetFullBIP44Path returns the BIP44Prefix. +func (config *Config) GetFullBIP44Path() string { return fmt.Sprintf("m/%d'/%d'/0'/0/0", config.purpose, config.coinType) } diff --git a/types/config_test.go b/types/config_test.go index 54a1fe48b527..f5a61444b584 100644 --- a/types/config_test.go +++ b/types/config_test.go @@ -17,18 +17,6 @@ func TestConfigTestSuite(t *testing.T) { suite.Run(t, new(configTestSuite)) } -func (s *configTestSuite) TestConfig_SetFullFundraiserPath() { - config := sdk.NewConfig() - config.SetFullFundraiserPath("test/path") - s.Require().Equal("test/path", config.GetFullFundraiserPath()) - - config.SetFullFundraiserPath("test/poth") - s.Require().Equal("test/poth", config.GetFullFundraiserPath()) - - config.Seal() - s.Require().Panics(func() { config.SetFullFundraiserPath("x/test/path") }) -} - func (s *contextTestSuite) TestConfig_SetPurpose() { config := sdk.NewConfig() config.SetPurpose(44) @@ -52,6 +40,18 @@ func (s *configTestSuite) TestConfig_SetCoinType() { s.Require().Panics(func() { config.SetCoinType(99) }) } +func (s *configTestSuite) TestConfig_SetFullFundraiserPath() { + config := sdk.NewConfig() + config.SetFullFundraiserPath("test/path") + s.Require().Equal("test/path", config.GetFullFundraiserPath()) + + config.SetFullFundraiserPath("test/poth") + s.Require().Equal("test/poth", config.GetFullFundraiserPath()) + + config.Seal() + s.Require().Panics(func() { config.SetFullFundraiserPath("x/test/path") }) +} + func (s *configTestSuite) TestConfig_SetTxEncoder() { mockErr := errors.New("test") config := sdk.NewConfig() From 36500d82dd34f5909888902dde9626bcc5b211dd Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Mon, 22 Feb 2021 13:00:24 +0100 Subject: [PATCH 6/8] Update types/address.go Co-authored-by: Alessio Treglia --- types/address.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/address.go b/types/address.go index 1458328bd610..9f3f8216051e 100644 --- a/types/address.go +++ b/types/address.go @@ -26,7 +26,7 @@ const ( // config.SetBech32PrefixForAccount(yourBech32PrefixAccAddr, yourBech32PrefixAccPub) // config.SetBech32PrefixForValidator(yourBech32PrefixValAddr, yourBech32PrefixValPub) // config.SetBech32PrefixForConsensusNode(yourBech32PrefixConsAddr, yourBech32PrefixConsPub) - // config.SetPurpose(yourPurpose) + // config.SetPurpose(yourPurpose) // config.SetCoinType(yourCoinType) // config.Seal() From 5860a5bd894dde4613636ccb38f294ae5209db12 Mon Sep 17 00:00:00 2001 From: "riccardo.montagnin" Date: Mon, 22 Feb 2021 13:02:47 +0100 Subject: [PATCH 7/8] Restored test --- types/config_test.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/types/config_test.go b/types/config_test.go index f5a61444b584..df281b1f852a 100644 --- a/types/config_test.go +++ b/types/config_test.go @@ -40,18 +40,6 @@ func (s *configTestSuite) TestConfig_SetCoinType() { s.Require().Panics(func() { config.SetCoinType(99) }) } -func (s *configTestSuite) TestConfig_SetFullFundraiserPath() { - config := sdk.NewConfig() - config.SetFullFundraiserPath("test/path") - s.Require().Equal("test/path", config.GetFullFundraiserPath()) - - config.SetFullFundraiserPath("test/poth") - s.Require().Equal("test/poth", config.GetFullFundraiserPath()) - - config.Seal() - s.Require().Panics(func() { config.SetFullFundraiserPath("x/test/path") }) -} - func (s *configTestSuite) TestConfig_SetTxEncoder() { mockErr := errors.New("test") config := sdk.NewConfig() @@ -65,6 +53,18 @@ func (s *configTestSuite) TestConfig_SetTxEncoder() { s.Require().Panics(func() { config.SetTxEncoder(encFunc) }) } +func (s *configTestSuite) TestConfig_SetFullFundraiserPath() { + config := sdk.NewConfig() + config.SetFullFundraiserPath("test/path") + s.Require().Equal("test/path", config.GetFullFundraiserPath()) + + config.SetFullFundraiserPath("test/poth") + s.Require().Equal("test/poth", config.GetFullFundraiserPath()) + + config.Seal() + s.Require().Panics(func() { config.SetFullFundraiserPath("x/test/path") }) +} + func (s *configTestSuite) TestKeyringServiceName() { s.Require().Equal(sdk.DefaultKeyringServiceName, sdk.KeyringServiceName()) } From 02409e5dcba6b29ceb7a1bbac962a6b6ef8cca12 Mon Sep 17 00:00:00 2001 From: "riccardo.montagnin" Date: Mon, 22 Feb 2021 13:32:38 +0100 Subject: [PATCH 8/8] Updated CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45f1a74b7650..94aac2494098 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,7 +48,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/gov) [\#8473](https://github.com/cosmos/cosmos-sdk/pull/8473) On genesis init, if the gov module account balance, coming from bank module state, does not match the one in gov module state, the initialization will panic. * (x/distribution) [\#8473](https://github.com/cosmos/cosmos-sdk/pull/8473) On genesis init, if the distribution module account balance, coming from bank module state, does not match the one in distribution module state, the initialization will panic. * (client/keys) [\#8500](https://github.com/cosmos/cosmos-sdk/pull/8500) `InfoImporter` interface is removed from legacy keybase. -* [\#8629](https://github.com/cosmos/cosmos-sdk/pull/8629) Removed `SetFullFundraiserPath` from `Config` in favor of `SetPurpose` and `SetCoinType`. +* [\#8629](https://github.com/cosmos/cosmos-sdk/pull/8629) Deprecated `SetFullFundraiserPath` from `Config` in favor of `SetPurpose` and `SetCoinType`. ### State Machine Breaking